コード例 #1
0
ファイル: module_rss.py プロジェクト: jojonas/pykindletools
	def __init__(self, url):
		data = urllib2.urlopen(url).read()
		self.etree = xml.etree.ElementTree.fromstring(data).find("./channel")
		
		self.rss_title = self.etree.find("./title").text.strip()
		# a little late...
		Book.__init__(self, "RSS: {title}".format(title=self.rss_title)) 
コード例 #2
0
	def __init__(self, url, username, password):
		self.username = username
		self.password = password
		
		self.server = xmlrpclib.ServerProxy(url).wp
		meta = self.server.getUsersBlogs(self.username, self.password)[0]
		
		self.blog_title = meta['blogName']
		self.blog_id = meta['blogid']
		Book.__init__(self, "Wordpress: {title}".format(title=self.blog_title))
コード例 #3
0
	def __init__(self, token, searchNotebook, count=50):
		self.client = EvernoteClient(token=token)
		self.noteStore = self.client.get_note_store()
		
		found = []
		for notebook in self.noteStore.listNotebooks():
			if searchNotebook in notebook.name:
				found.append(notebook)
				
		if len(found) < 1:
			raise IOError("Notebook not found.")
		elif len(found) > 1:
			raise IOError("%d notebooks match the criteria." % len(found))
			
		self.notebook = found[0]
		
		Book.__init__(self, "Evernote: {title}".format( \
			title=self.notebook.name))
		
		self.count = count
		self.user = self.client.get_user_store().getUser()
コード例 #4
0
	def __init__(self, title, lang="en"):
		Book.__init__(self, u"Wikipedia: {title}".format(title=title))
		wikipedia.set_lang(lang)
		self.page = wikipedia.page(title)