mirror of
https://github.com/hongtaocai/googlefinance.git
synced 2025-02-25 18:55:20 -06:00
fix python3 support
This commit is contained in:
parent
d5a6aa096c
commit
6a541b7fda
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.pyc
|
||||
build/*
|
||||
|
@ -2,5 +2,5 @@ from googlefinance import getQuotes
|
||||
from googlefinance import getNews
|
||||
|
||||
import json
|
||||
print json.dumps(getQuotes('GOOG'), indent=2)
|
||||
print json.dumps(getNews("GOOG"), indent=2)
|
||||
print(json.dumps(getQuotes('GOOG'), indent=2))
|
||||
print(json.dumps(getNews("GOOG"), indent=2))
|
||||
|
@ -52,7 +52,7 @@ def request(symbols):
|
||||
|
||||
def requestNews(symbol):
|
||||
url = buildNewsUrl(symbol)
|
||||
print "url: ", url
|
||||
print("url: ", url)
|
||||
req = Request(url)
|
||||
resp = urlopen(req)
|
||||
content = resp.read()
|
||||
@ -116,4 +116,4 @@ if __name__ == '__main__':
|
||||
symbols = symbols.split(',')
|
||||
|
||||
print(json.dumps(getNews("GOOG"), indent=2))
|
||||
print(json.dumps(getQuotes(symbols), indent=2))
|
||||
print(json.dumps(getQuotes(symbols), indent=2))
|
||||
|
Loading…
Reference in New Issue
Block a user