[Resolved] Please a little guidance would be appreciated

Hi Dear Developers

1 - Is there anywhere that I could get the code for something like a book library app ? Something that I could use to manage what books I have in and what books will be avaialable in certain date.
2- For the second little project I would like to be able to use something like the command “PING” to check websites avaiability. DOes anyone knows how could I create a simple code for that?

Thank you all [import]uid: 166125 topic_id: 29550 reply_id: 329550[/import]

I haven’t seen a code sample around for the first kind of thing but it’s definitely possible.

For the second, are these your sites you are checking or no? [import]uid: 52491 topic_id: 29550 reply_id: 118668[/import]

Hi Peach,

Very nice hear from you, I m doing all your tutorials they are really easy to understand… In regards to websites monitoring Im just wondering if I could create something to check any website availability . For example ping www.google.com

Looking forward to hear back from you [import]uid: 166125 topic_id: 29550 reply_id: 118840[/import]

Hey again Oly,

Glad to hear you are liking my tutorials :slight_smile:

Try running this code - I am not certain if it will work for what you want or not but I think it might; give it a go and let me know;
[lua]local http = require(“socket.http”)

if http.request( “http://www.google.com” ) == nil then
native.showAlert( “Alert!”, “Site not loading”, { “OK” }, onCloseApp )
else print “Site is up”
end[/lua]

Peach :slight_smile:

PS - Obviously changing Google to the site you want to check on :wink: [import]uid: 52491 topic_id: 29550 reply_id: 118853[/import]

Thats it… You great… Thanks heaps Peach… [import]uid: 166125 topic_id: 29550 reply_id: 119139[/import]

HI Peach

Just a direction: Lets say I want to check many websites lets say 50. What would be the best approach? DB? ego? Because I imagine that I need to have a function that going to check each website address entry.

Something like :if http.request( “websitesList” ) == nil then
native.showAlert( “Alert!”, “Site not loading”, { “OK” }, onCloseApp )

In somewhere and somehow will be stored the websites list.

Please advise
Best Regards [import]uid: 166125 topic_id: 29550 reply_id: 120010[/import]

Ego is not for that kind of thing, sqlite is one option, reading in a text file with one site per line is also a good option and very easy.

Peach :slight_smile: [import]uid: 52491 topic_id: 29550 reply_id: 120019[/import]

Thanks Peach :slight_smile: [import]uid: 166125 topic_id: 29550 reply_id: 120041[/import]

HI Peach

Just a direction: Lets say I want to check many websites lets say 50. What would be the best approach? DB? ego? Because I imagine that I need to have a function that going to check each website address entry.

Something like :if http.request( “websitesList” ) == nil then
native.showAlert( “Alert!”, “Site not loading”, { “OK” }, onCloseApp )

In somewhere and somehow will be stored the websites list.

Please advise
Best Regards [import]uid: 166125 topic_id: 29550 reply_id: 120010[/import]

Ego is not for that kind of thing, sqlite is one option, reading in a text file with one site per line is also a good option and very easy.

Peach :slight_smile: [import]uid: 52491 topic_id: 29550 reply_id: 120019[/import]

Thanks Peach :slight_smile: [import]uid: 166125 topic_id: 29550 reply_id: 120041[/import]