pax_global_header 0000666 0000000 0000000 00000000064 13436457030 0014517 g ustar 00root root 0000000 0000000 52 comment=3863a14eedf17551743a8bbccf0237874d7f4a16
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/ 0000775 0000000 0000000 00000000000 13436457030 0022707 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/modules/ 0000775 0000000 0000000 00000000000 13436457030 0024357 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/modules/blogspot/ 0000775 0000000 0000000 00000000000 13436457030 0026210 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/modules/blogspot/__init__.py 0000664 0000000 0000000 00000001564 13436457030 0030327 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from __future__ import unicode_literals
from .module import BlogspotModule
__all__ = ['BlogspotModule']
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/modules/blogspot/browser.py 0000664 0000000 0000000 00000005604 13436457030 0030252 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from __future__ import unicode_literals
from collections import OrderedDict
from datetime import date
from weboob.browser import PagesBrowser, URL
from weboob.capabilities.messages import Message
from .pages import DatePage, IndexPage, ArticlePage
class BlogspotBrowser(PagesBrowser):
BASEURL = 'http://www.blogspot.com'
index = URL(r'/$', IndexPage)
date = URL(r'/\?action=getTitles&widgetId=BlogArchive1&widgetType=BlogArchive&responseType=js&path=(?P.*)', r'/(?P\d+)/(?P\d+)/$', DatePage)
article = URL(r'/(?P\d+)/(?P\d+)/(?P.*).html$', ArticlePage)
def __init__(self, baseurl, *args, **kwargs):
super(BlogspotBrowser, self).__init__(*args, **kwargs)
self.BASEURL = baseurl
self.cache = OrderedDict()
def iter_dates(self):
if not self.cache:
self.index.go()
for url in self.page.get_dates():
m = self.date.match(url)
key = (m.group('year'), m.group('month'))
self.cache[key] = None
for k in self.cache:
yield self.build_date(k)
def iter_articles(self, key):
if self.cache[key] is None:
query = self.date.build(year=key[0], month=key[1])
self.date.go(query=query)
self.cache[key] = list(self.page.get_articles())
for j in self.cache[key]:
yield self.build_article(j)
def build_date(self, k):
ret = Message(id='%s.%s' % k)
ret.title = '%s/%s' % k
ret.content = ''
ret.date = date(int(k[0]), int(k[1]), 1)
ret._type = 'date'
ret._key = k
return ret
def build_article(self, j):
m = self.article.match(j['url'])
ret = Message(id=m.group('title'))
ret.title = j['title']
ret.url = j['url']
ret.flags = Message.IS_HTML
ret.date = date(int(m.group('year')), int(m.group('month')), 1)
ret.children = []
ret._type = 'article'
return ret
def get_article(self, url):
self.location(url)
assert self.article.is_here()
return self.page.get_message()
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-blogspot/modules/blogspot/favicon.png 0000664 0000000 0000000 00000001352 13436457030 0030344 0 ustar 00root root 0000000 0000000 PNG
IHDR L\ pHYs tIME+/B] iTXtComment Created with GIMPd.e `IDATxAR@~N"<_U!5#O" @ ])˺]qٯ nYg f}
g0:/t= dЫ0d@#A1LC(m>ATHzz$a4juPR D (~ ~JuO;)= "~;p5 LN@`
ʻ#/7w5SPeNj{|N9p nLȀW6|B&{$g@*f8:hnNkFH74Y&&nɾpq;sY9
'3"A1x5e+B
qF
39a&