Skip to content

Instantly share code, notes, and snippets.

View muzizongheng's full-sized avatar

muzizongheng(李建功) muzizongheng

View GitHub Profile
@muzizongheng
muzizongheng / myFirstCodeSnippet
Created June 19, 2013 06:16
my first code snippet
public myFirstCodeSnippet
{
string Test {get; set;}
}
@muzizongheng
muzizongheng / EDAMTest_GetNotes.py
Created June 25, 2013 08:09
use evernote api to get every note(include: tilte, content, resource)
# List all of the notebooks in the user's account
notebooks = noteStore.listNotebooks(authToken)
print("Found ", len(notebooks), " notebooks:")
for notebook in notebooks:
print(" * ", notebook.name)
filter = NoteStore.NoteFilter()
filter.notebookGuid = notebook.guid
noteList = noteStore.findNotes(authToken, filter, 0, 50)
@muzizongheng
muzizongheng / EDAMTest2.py
Created June 27, 2013 01:07
open file by utf-8
f = open(n.title+".html", "w+", encoding='utf-8-sig')
f.write(content)
f.close()
@muzizongheng
muzizongheng / AccessEN.py
Created June 27, 2013 07:29
Parse evernote's note(include resource, content, title, tags)
#
# 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
#
import string
from datetime import datetime
from flask import url_for
from flask.ext.xmlrpc import XMLRPCHandler, Fault
from labs import app, db
from labs.models import User, Post, Tag, Category
# MetaWeblogAPI XML-RPC
handler = XMLRPCHandler('api')
handler.connect(app, '/api')
#!/usr/bin/python
""""
Copyright 2008 Ritesh Nadhani. All Rights Reserved.
For license information please check the LICENSE page of the package.
"""
#!/usr/bin/python
import cgi, cgitb
# Uncomment this to view errors
# cgitb.enable()
import urlparse
import urllib
import sys
import oauth2 as oauth
@muzizongheng
muzizongheng / AccessEN.py
Created July 1, 2013 06:39
convert evernote's tags to blog's categories
#create blog category by tags
tagslist = noteStore.listTagsByNotebook(authToken, notebook.guid)
categories = convertTags2Category(tagslist)
try:
for c in categories:
metaweblog.new_category(c)
except Exception as err:
print("Create category failed: ", err)
finally:
@muzizongheng
muzizongheng / AccessCSDN.py
Last active February 29, 2024 15:09
login CSDN by using urllib
#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?"
@muzizongheng
muzizongheng / httpencode.py
Created July 18, 2013 06:00
http encode/decode
import base64
from http import cookiejar
import urllib.request, urllib.parse, urllib.error
url = "http://blog.csdn.net/muzizongheng"
en = urllib.parse.quote(url)
print(en)
de = urllib.parse.unquote(en)
print(de)