Skip to content

Commit

Permalink
Removed reppy. Bump to 3.0.1. Closes #49
Browse files Browse the repository at this point in the history
  • Loading branch information
Benny- committed Dec 1, 2018
1 parent fe63242 commit 3058357
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Download history for symbols: ystockquote_
Changelog
---------------------

* Version 3.0.1 (2018-12-01)

* Removed reppy dependency

* Version 3.0.0 (2018-05-27)

* Switched over to different JSON api (searchassist)
Expand Down
11 changes: 6 additions & 5 deletions YahooTickerDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ytd.downloader.GenericDownloader import GenericDownloader
from ytd.compat import text
from ytd.compat import csv
from reppy.robots import Robots
from ytd.compat import robotparser

import tablib

Expand Down Expand Up @@ -95,13 +95,14 @@ def main():
else:
downloader = options[tickerType]

robotsUrl = protocol + '://finance.yahoo.com/robots.txt'
robots = Robots.fetch(robotsUrl)
rp = robotparser.RobotFileParser()
rp.set_url(protocol + '://finance.yahoo.com/robots.txt')
rp.read()
try:
if not args.export:

if(not robots.allowed(protocol + '://finance.yahoo.com/_finance_doubledown/api/resource/searchassist', user_agent)):
print('Execution of script halted due to ' + robotsUrl)
if(not rp.can_fetch(user_agent, protocol + '://finance.yahoo.com/_finance_doubledown/api/resource/searchassist')):
print('Execution of script halted due to robots.txt')
return 1

if not downloader.isDone():
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name = 'Yahoo-ticker-downloader',
version = '3.0.0',
version = '3.0.1',
author = 'Benny Jacobs',
author_email = 'Benny@GMX.it',
url='https://github.com/Benny-/Yahoo-ticker-symbol-downloader',
Expand All @@ -18,7 +18,6 @@
"requests >= 2.4.3",
"tablib >= 0.9.11",
"backports.csv >= 1.0.4",
"reppy >= 0.4.9",
],
classifiers=[
"Operating System :: OS Independent",
Expand Down
2 changes: 2 additions & 0 deletions ytd/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

if is_py3:
text = str
from urllib import robotparser
import csv
from urllib.parse import quote
else:
text = unicode
import robotparser
from backports import csv
from urllib import quote

0 comments on commit 3058357

Please sign in to comment.