-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchrome.py
49 lines (40 loc) · 1.48 KB
/
chrome.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'''
Created on 02.08.2012
@author: avkoltsov
'''
from browser import Browser
from datetime import date
from google_reader_page import GoogleReaderPage
if __name__ == '__main__':
driver = None
articles_to_read = []
earliest_date = date.today()
try:
#
driver = Browser.getFF()
page = GoogleReaderPage(driver)
page.open_page()
lis = page.get_subscriptions()
for li in lis:
if li.is_displayed():
page.open_subscription(li)
page.scroll_entries_down()
entries = page.get_entries()
entries.reverse()
early_enrty_date = page.get_date(entries[0])
print '%s (%s) %s' % (li.text, len(entries), early_enrty_date)
if early_enrty_date < earliest_date:
earliest_date = early_enrty_date
articles_to_read = []
if early_enrty_date == earliest_date:
for entry in entries:
enrty_date = page.get_date(entry)
if enrty_date == early_enrty_date:
articles_to_read.append(entry.text)
else:
break
finally:
driver.quit()
print '=' * 80
for article in articles_to_read:
print article