Get data from web
#1

Hi guys, it is possible to make in pawno to get data from web about temparature in my city?
i have www.mysite.com/temparature.php and it look like this: http://prntscr.com/5eugdh so how can i get that data from pawno?
Reply
#2

Quote:
Originally Posted by Dusan01
Посмотреть сообщение
Hi guys, it is possible to make in pawno to get data from web about temparature in my city?
i have www.mysite.com/temparature.php and it look like this: http://prntscr.com/5eugdh so how can i get that data from pawno?
Hello Dusan01,

I think the best option is to use an api to retrieve the weather status, of course, that will depend on your level of scripting but it's not that hard,

Use the http://www.previsaodotempo.org/api api to retrieve the weather status of all major cities around the world and upstate cities in Brazil (because it is a Brazilian api, if you know some other api feel free to use it).

Use the HTTP https://sampwiki.blast.hk/wiki/HTTP class to make a request to the api endpoint, like so:

To see a live example of what is returned and understand a lil bit more from these requests just try to access these "links" above in your browser and, sure, you can change the city variable to whatever you wish.

Use the DJson https://sampforum.blast.hk/showthread.php?tid=48439 package to handle the response format (json) inside Pawn.

Best regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)