This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Use this utility to access CSDN blog. | |
#Author: jiangong li | |
#Email: Jgli_2008@sina.com | |
import base64 | |
from http import cookiejar | |
import urllib.request, urllib.parse, urllib.error | |
#url for accessing | |
csdnLoginUrl = r"http://passport.csdn.net/ajax/accounthandler.ashx?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#init evernote client | |
def initEvernote(self): | |
# Real applications authenticate with Evernote using OAuth, but for the | |
# purpose of exploring the API, you can get a developer token that allows | |
# you to access your own Evernote account. To get a developer token, visit | |
# https://sandbox.evernote.com/api/DeveloperToken.action | |
if self.authToken == "": | |
self.authToken = input("Please input your dev token: ") | |
if self.authToken == "": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# A simple Evernote API demo script that lists all notebooks in the user's | |
# account and creates a simple test note in the default notebook. | |
# | |
# Before running this sample, you must fill in your Evernote developer token. | |
# | |
# To run (Unix): | |
# export PYTHONPATH=../lib; python EDAMTest.py | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ping search engine's ping service | |
# http://ping.baidu.com/ping/RPC2 | |
# http://rpc.pingomatic.com/ | |
# http://api.moreover.com/ping | |
# http://api.my.yahoo.com/rss/ping | |
# http://blogsearch.google.com/ping/RPC2 | |
# http://ping.bitacoras.com | |
# http://ping.feedburner.com | |
# http://ping.syndic8.com/xmlrpc.php | |
# http://rpc.blogrolling.com/pinger/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#calculate hashcode for media | |
md5 = hashlib.md5() | |
md5.update(attachment.data.body) | |
hashcode = md5.hexdigest() | |
print("hast code: ", hashcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("first example") | |
print("second", "example") | |
print("%s"%("third example")) | |
print("%(forth)s"%{'forth':'forth example'}) | |
fifth = "fifth example" | |
print("%(fifth)s"%vars()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all of the notebooks in the user's account | |
notebooks = noteStore.listNotebooks(authToken) | |
print("Found ", len(notebooks), " notebooks:") | |
#calculate processed blog count currently | |
processedBlogCount = 0 | |
for notebook in notebooks: | |
print(" * ", notebook.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.isCreateTags = config["isCreateTags"] == str(True) | |
self.syncNotebook = config["syncNotebook"] | |
self.isUsingCSDNBlog = config["isUsingCSDNBlog"] == str(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#read config | |
input_text = open('config', "r", encoding='utf-8-sig').read() | |
input_json = "{%(input_text)s}" % vars() | |
reader = json.JSONDecoder() | |
config = reader.decode(input_json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pingServiceUrls = open("pingcfg", "r", encoding='utf-8-sig') | |
pingServiceUrls.seek(0) | |
self.pingServiceUrls = pingServiceUrls.readlines() | |
print(self.pingServiceUrls) |
NewerOlder