How can i import the Yahoo weather in my app ?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Atooty
Posts: 5
Joined: Tue Dec 03, 2013 6:07 pm

How can i import the Yahoo weather in my app ?

Post by Atooty » Tue Dec 03, 2013 6:14 pm

Hello
i just found this topic and i did all the things step by step
http://forums.runrev.com/viewtopic.php?f=7&t=14938

but it only shows me the temp. of London!
and i wanna see the temp. of all the world countries
and i wanna choose the country i mean the user write the name of his/her country and the temp. got displayed for him/her

PLEASE HELP :(
it is my senior project!

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: How can i import the Yahoo weather in my app ?

Post by Jellicle » Tue Dec 03, 2013 9:54 pm

Each location has its own RSS feed. That example only includes the feed for London. So you need a list of the available feeds (and each feed address) so that the user can select the location they want to view.

Check out http://developer.yahoo.com/weather/ for more details.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Atooty
Posts: 5
Joined: Tue Dec 03, 2013 6:07 pm

Re: How can i import the Yahoo weather in my app ?

Post by Atooty » Wed Dec 04, 2013 9:40 am

i checked it but i didn't know how to get the RSS feeds for each country from the website you gave me :(

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: How can i import the Yahoo weather in my app ?

Post by endernafi » Wed Dec 04, 2013 9:53 am

Atooty,

Here is the simplest way to find a particular WOEID:
1. Navigate to http://weather.yahoo.com
2. Enter the location's name into the search bar and hit enter.
3. When the page opened, look at the address bar of your browser;
the url should look like this:
http://weather.yahoo.com/united-states/ ... e-2490383/
That 7 digit number at the end is the unique ID of the city.
4. Put the code into the right place of the feed example in the document which Gerry linked.

After these steps, you should get Seattle's rss feed as following:
http://weather.yahooapis.com/forecastrss?w=2490383
or
feed://weather.yahooapis.com/forecastrss?w=2490383


Best,

~ Ender Nafi
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

Atooty
Posts: 5
Joined: Tue Dec 03, 2013 6:07 pm

Re: How can i import the Yahoo weather in my app ?

Post by Atooty » Sat Dec 07, 2013 2:16 pm

ok i did it and it works
but i really dont know how to let the user write the country he wants and then get the temperature .
am really not that good in programming and live code is very new for me
if any one can help me with the code please :(

1. like i have a "Text entry field"
2. then the user write the location in it
3. he gets a page with the temperature like the Yahoo weather page
and that's it

PLEASE HELP ME <3

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: How can i import the Yahoo weather in my app ?

Post by Jellicle » Mon Dec 09, 2013 7:40 am

Atooty wrote: PLEASE HELP ME <3
Just think for a moment. What needs to be done to get and use the text a user types into a field? There are LiveCode commands and functions that work on fields, including the ability to put text into fields, get the text in a field and to detect when the user types into a field. Look them up. Learn about fields.

Come back with a script and we'll look at it. But it's just plain rude to expect us to do all the work for you.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Atooty
Posts: 5
Joined: Tue Dec 03, 2013 6:07 pm

Re: How can i import the Yahoo weather in my app ?

Post by Atooty » Tue Dec 10, 2013 8:21 am

hello Gerry,

first of all i didn't mean by my comment to get my project done by the members here, i was simply asking for help in some problems in my project , and pages like these are created for asking other for it whats wrong in that?

and by the way i saw some topics similar to this where people didn't provide codes but they get help anyways with people willing to help with all politeness!
thank you for your previous help but if you don't want to help me anymore, you don't need to tell me am RUDE! cuz i am not :) !

Regards, Atooty.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How can i import the Yahoo weather in my app ?

Post by Simon » Tue Dec 10, 2013 8:45 am

Hey Atooty,
You still haven't posted any of your code.
Show us what you have done and we can show you where you went wrong :)

Do you see that the city is called from the last numbers of this;
http://weather.yahooapis.com/forecastrss?w=2490383

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Re: How can i import the Yahoo weather in my app ?

Post by paul_gr » Tue Dec 10, 2013 10:45 am

Hi Atooty,

Drop a button on a stack with this script in it.

on mouseUp
put url "http://xml.weather.yahoo.com/forecastrss?p=UKXX0085" into fld1
end mouseUp

Drop a field and name it fld1

UKXX0085 is the code for London UK and the XML feed loads into the field when you press the button.
All the information you want is in there.
Just work out what you need then extract it from any lines that have the info you want...

The weather codes for any location are not hard to find. eg
London: UKXX0085
Glasgow: UKXX0061
Manchester: UKXX0092
Liverpool: UKXX0083

In the US I think you can also use the Zipcode for any location. eg
New York: USNY0996
San Francisco: USCA0987
Chicago: USIL0225

Paul

Post Reply