-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherss.py
More file actions
32 lines (26 loc) · 850 Bytes
/
erss.py
File metadata and controls
32 lines (26 loc) · 850 Bytes
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
# -*- coding: utf-8 -*-
import urllib
import urllib2
import cookielib
import emagister2rss
def login(email, password):
cookie = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
data = urllib.urlencode({"mail":email,"password":password})
url_s = "http://grupos.emagister.com/index/signin"
opener.open(url_s,data)
return opener
def EtoRss(opener):
url = "http://grupos.emagister.com"
urls = {'wall':url+"/userhome/#wall_all",
'groups':url+"/perfil/grupos",}
for url_ in urls:
s = opener.open(urls[url_])
content = (s.read()).decode("latin-1")
getattr(emagister2rss,'rss_'+url_)(content,opener)
def run(email,password):
import time
opener = login(email,password)
while(1):
EtoRss(opener)
time.sleep(60)