tsroten / yweather Goto Github PK
View Code? Open in Web Editor NEWa Python module that provides an interface to Yahoo! Weather
License: MIT License
a Python module that provides an interface to Yahoo! Weather
License: MIT License
The README file should have syntax highlighting in the example code to make it more readable.
The unit tests shouldn't actually download data. Let's use mock data instead and keep the tests running faster.
using the yweather module in python returns a long error. Shortened to a few words: server not found. The service has probably been abandoned by Yahoo, since http://xml.weather.yahoo.com/ does not exist anymore.
Hi! I used the python module pywapi to extract weather informations, but when Yahoo changed its API, it didn't work. So I downloaded yweather from git and I launched the command python3 setup.py install inside the directory yweather. After that, I was trying to catch some weather informations about my city and I wrote this code:
import yweather
client = yweather.Client()
result = client.fetch_weather("12798281", metric=True)
print(result)
result = client.fetch_weather("12798281", metric=True)
File "/home/SmartStation/yweather.py", line 180, in fetch_weather
rss = self._fetch_xml(url)
File "/home/SmartStation/yweather.py", line 344, in _fetch_xml
with contextlib.closing(urlopen(url)) as f:
File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(_args)
File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(_args)
File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Connection refused
What is the problem? I'm using Python 3.4.3 on my Raspberry PI B+. I couldn't use pip, because pip3 didn't work.
vegaswe = client.fetch_weather("2436704")
Traceback (most recent call last):
File "", line 1, in
File "C:\Tools\Python(x86)\Python27\lib\site-packages\yweather.py", line 180, in fetch_weather
rss = self._fetch_xml(url)
File "C:\Tools\Python(x86)\Python27\lib\site-packages\yweather.py", line 344, in _fetch_xml
with contextlib.closing(urlopen(url)) as f:
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 429, in open
response = self._open(req, data)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 447, in _open
'_open', req)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Tools\Python(x86)\Python27\lib\urllib2.py", line 1201, in do_open
r = h.getresponse(buffering=True)
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 1136, in getresponse
response.begin()
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "C:\Tools\Python(x86)\Python27\lib\httplib.py", line 417, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
I was just trying this out for the first time. This may be an easy fix because I am just a noob so please tell me if this is something I am doing thanks.
Link: https://yweather.readthedocs.org/
Results in page not found: "You've found something that doesn't exist."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.