Archive for google

Google Chrome 禁用Flash、图片或脚本的方法

使用 -disable-plugins 参数启动Chrome就会禁用Flash。
-disable-images 参数是禁用图片,-disable-javascript是禁用脚本。

在提供chromium最新版的地址

http://build.chromium.org/buildbot/snapshots/chromium-rel-xp/?O=D

No comment »

使用Python gdata 操作谷歌网络相册

下面是一个使用python gdata 上传图片并获得图片地址的简单例子。需要gdata库。

In [2]: import gdata.photos, gdata.photos.service
In [3]: pws = gdata.photos.service.PhotosService()
# 下面输入谷歌的帐号
In [4]: pws.ClientLogin(帐号,密码)
In [6]: albums = pws.GetUserFeed()
In [7]: for album in albums.entry:
   ...:     print 'title: %s, number of photos: %s, id: %s' % (album.title.text,
   ...:         album.numphotos.text, album.gphoto_id.text)
   ...:
title: uptest, number of photos: 0, id: 相册ID
title: XXX, number of photos: 1, id: XXX
title: XXX, number of photos: 10, id: XXX

# 获得某个相册的全部照片
In [X]: photos = pws.GetFeed(albums.entry[0].GetPhotosUri()).entry
In [X]: for p in photos:
    print 't:%s\r\nurl:%s' %(p.title.text,p.GetMediaURL())
t:New Photo
url:http://lh3.ggpht.com/_?/?/?/?/New%20Photo.jpg

In [8]: import urllib
In [9]: f1 = urllib.urlopen('来源URL')
In [10]: f1.name='aaaaaaa'

In [15]: album_url = '/data/feed/api/user/%s/albumid/%s' % ('default', 相册ID)

# 这里使用的是句柄,也可以直接输入本地文件路径
# content_type需要根据图片类型变更(默认是image/jpeg)。
In [21]: photo = pws.InsertPhotoSimple(album_url, 'New Photo','文本必须是utf8编码的str字符串,unicode 字符串乱码。', f1, content_type=f1.info().type)

# 获得图片的地址,可以用于外连。(即使设置为非公开的图片也可以使用下面的连接匿名访问。)
In [23]: photo.GetMediaURL()
Out[23]: 'http://lh3.ggpht.com/_?/?/?/?/?.jpg'

# 获得缩略图
In [25]: for th in photo.media.thumbnail:
   ....:     print th.url

http://lh3.ggpht.com/_?/?/?/?/s72/?.jpg

http://lh3.ggpht.com/_?/?/?/?/s144/?.jpg

http://lh3.ggpht.com/_?/?/?/?/s288/?.jpg

参考:

http://code.google.com/intl/zh-CN/apis/picasaweb/developers_guide_python.html

No comment »

使用谷歌文件发布 wordpress 博客

进入谷歌文件设置,选择博客设置=>编辑信息。

选择  ”我自己的服务器/自定义” ,API 使用 MetaWeblog API 使用 MovableType 不支持标题)。
我的 URL 是 http://gamexg-cw.cn/xmlrpc.php 自己的照着改就可以了。
 用户名和密码填博客的用户名和密码。
博客 ID/标题 留空。现在点测试如果没问题就点击确定保存设置。

现在已经设置完成了博客信息,随便建立一个文件写点内容就可以尝试发布了。
打开想发到博客的文件,选择共享=>以网页形式发布=>张贴到博客就可以了。
这篇文章就是这样发布的。

一些问题:目录和标签并不能支持,不过我记得有个插件可以自动生成标签(也可以使用内部标签)。

No comment »

什么时候提供linux版就好了

No comment »