Git Product home page Git Product logo

yweather's People

Contributors

tsipinio avatar tsroten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yweather's Issues

HTTP Error 502: Connection refused

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.

httplib.BadStatusLine:

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.