显示标签为“模板”的博文。显示所有博文
显示标签为“模板”的博文。显示所有博文
| View Comments ]


昨日取得了EverNote 的 API开发资料,看见有提供Python的api库自然欣喜若狂,不过偶这点水平也就只能拿它的sample来玩玩,并且还在考虑写份关于浏览器是否足以掌控一切的博文,可是最近真是烦透了,一点心思也没有。只是在博客中添加了较为好看的源代码显示效果,来欣赏一下,等偶有时间时再完成那篇[巨著],呵呵

import time
import thrift.transport.THttpClient as THttpClient
import thrift.protocol.TBinaryProtocol as TBinaryProtocol
import evernote.edam.userstore.UserStore as UserStore
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.notestore.NoteStore as NoteStore
import evernote.edam.type.ttypes as Types

#
# Configure these based on the API key you received from Evernote
#
consumerKey = ""
consumerSecret = ""
username = ""
password = ""

edamHost = "lb.evernote.com"
edamPort = 443

userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user")
userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient)
userStore = UserStore.Client(userStoreProtocol)

versionOK = userStore.checkVersion("Python EDAMTest",
                                   UserStoreConstants.EDAM_VERSION_MAJOR,
                                   UserStoreConstants.EDAM_VERSION_MINOR)

print "Is my EDAM protocol version up to date? ", str(versionOK)
if not versionOK:
    exit(1)

authResult = userStore.authenticate(username, password,
                                    consumerKey, consumerSecret)
user = authResult.user
authToken = authResult.authenticationToken
print "Authentication was successful for ", user.username
print "Authentication token = ", authToken
print userStore.getUser(authToken)
print userStore.getPublicUserInfo(username)

noteStoreUri = "/edam/note/" + user.shardId
noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri)
noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient)
noteStore = NoteStore.Client(noteStoreProtocol)

notebooks = noteStore.listNotebooks(authToken)
print "Found ", len(notebooks), " notebooks:"
for notebook in notebooks:
    print "  * ", notebook.name
    if notebook.defaultNotebook:
        defaultNotebook = notebook

print
print "Creating a new note in default notebook: ", defaultNotebook.name
print
note = Types.Note()
note.notebookGuid = defaultNotebook.guid
note.title = raw_input("Note title?  ").strip()
note.content = ''
note.content += ''
note.content += ''
note.content += raw_input("Well-formed XHTML note content?  ").strip()
note.content += ''
note.created = int(time.time() * 1000)
note.updated = note.created

createdNote = noteStore.createNote(authToken, note)

print "Created note: ", str(createdNote)

Read More...
| View Comments ]

      博客模板重新改造暂时告一段落,现在仍然还有一些毛病没有解决,主要是关于布局以及各浏览器兼容性等。博客模板下载地址为大家奉上,现在启用的模板是由DailyInspired重新修改而来,原来界面基本如下


      算是做了一番较大的修改,如图中首页内容显示仅显示标题,而当前所用模板则进行修订显示文章内容并增加Read more功能,至于左侧则进行了插件运用,搜索框功能的定制,Google Friend Connect以及留言板,还有博文详细内容部分则仍然恢复了之前的Disqus评论功能。修改完之后也算基本掌握了CSS要领,还有Blogger模板内部原生模块的调用。至于美观部分正在筹划和设计中……

模板下载地址

当前使用的DailyInspired



之前所用的is_simple-blogger
上图留念


-----------------------------------------------------

Read More...