GithubHelp home page GithubHelp logo

sunner / buzz2weibo Goto Github PK

View Code? Open in Web Editor NEW
34.0 6.0 10.0 271 KB

将Google+同步转发到新浪微博,包括图片、文字、链接和地理坐标

Home Page: http://weibo.com/sunnersun

License: MIT License

Python 100.00%

buzz2weibo's Introduction

buzz2weibo - 同步Google+到新浪微博

将Google+上的public消息转发到新浪微博,可包括文字、图片、链接和地理坐标

注:原为Google Buzz开发,所以叫buzz2weibo

特性

  • 同步文字,这个自然
  • 将 Google+ 单条消息中的所有图片拼接上传
  • 同步地理坐标,如果有的话
  • 如果buzz附有链接,也被同步
  • 每次运行缺省只同步3条,防止被新浪微博暂时封禁
  • 只同步public的消息,保护私密
  • 在新浪微博显示到Google+的链接

运行条件

这是一个在你自己的机器运行的程序,它不是一个网络服务,至少目前不是。

buzz2weibo的运行,必须满足如下条件

  • python 2.6 及以上版本,含Image库(python-imaging)
  • 能周期定时执行本程序,否则只能每次手工运行
  • 畅通的网络,非一般的畅通,你懂的

安装

下载、解压,完毕

当然用git clone会更舒服

配置

在解压目录下,运行

python setup.py

跟随屏幕操作。完成后,编辑config.py可以配置更多参数

使用

python buzz2weibo.py

建议

建议在Linux下使用,cron里设为每5分钟执行一次

链接

buzz2weibo's People

Contributors

marvelliu avatar sunner avatar wyvernbai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

buzz2weibo's Issues

再次运行同步时报错

panhaidong@ubuntu:/data/projects/source/buzz2weibo$ ./buzz2weibo.py 
-----------------------
syncing tag:google.com,2010:buzz:z13ldbgqus2wtlnq004cjlspvqv2cvjjzes
Google Reader
iPhone 4 即将成为 Flickr 上最热门的拍照设备 - 爱范儿: 拇指资讯小众讨论
http://www.ifanr.com/38530
http://www.ifanr.com/wp-content/uploads/2011/04/clip_image008_thumb.gif
clip_image008_thumb.gif
Traceback (most recent call last):
  File "./buzz2weibo.py", line 116, in 
    post2weibo(api, act)
  File "./buzz2weibo.py", line 44, in post2weibo
    status = api.upload(filename, status=message, lat=geo[0], long=geo[1])
  File "/data/projects/source/buzz2weibo/weibopy/api.py", line 203, in upload
    )(self, *args, **kargs)
  File "/data/projects/source/buzz2weibo/weibopy/binder.py", line 191, in _call
    return method.execute()
  File "/data/projects/source/buzz2weibo/weibopy/binder.py", line 177, in execute
    raise WeibopError(error_msg)
weibopy.error.WeibopError: error_code:401,40107:Oauth Error: signature_invalid!
panhaidong@ubuntu:/data/projects/source/buzz2weibo$ 

再次运行同步时报错

panhaidong@ubuntu:/data/projects/source/buzz2weibo$ ./buzz2weibo.py

syncing tag:google.com,2010:buzz:z13ldbgqus2wtlnq004cjlspvqv2cvjjzes
Google Reader
iPhone 4 即将成为 Flickr 上最热门的拍照设备 - 爱范儿: 拇指资讯小众讨论
http://www.ifanr.com/38530
http://www.ifanr.com/wp-content/uploads/2011/04/clip_image008_thumb.gif
clip_image008_thumb.gif
Traceback (most recent call last):
File "./buzz2weibo.py", line 116, in
post2weibo(api, act)
File "./buzz2weibo.py", line 44, in post2weibo
status = api.upload(filename, status=message, lat=geo[0], long=geo[1])
File "/data/projects/source/buzz2weibo/weibopy/api.py", line 203, in upload
)(self, _args, *_kargs)
File "/data/projects/source/buzz2weibo/weibopy/binder.py", line 191, in _call
return method.execute()
File "/data/projects/source/buzz2weibo/weibopy/binder.py", line 177, in execute
raise WeibopError(error_msg)
weibopy.error.WeibopError: error_code:401,40107:Oauth Error: signature_invalid!
panhaidong@ubuntu:/data/projects/source/buzz2weibo$

[feature]根据系统时间判断是否同步

buzz里会有很多以前的内容,不需要都同步到weibo上,希望能增加判断,只同步最近一周,或者一个月内的内容。老的内容就不需要同步了

IOError: encoder jpeg not available

Here is the output:


syncing z124jnxgloiiflprf04ci5chptn5fboizrs0k
https://plus.google.com/108880597196842544749/posts/gRM3uZ1yKhq
水立方 & 西单apple store...其实水是挖坑时候发现的,让我围起来了....
http://lh6.googleusercontent.com/--uA08CJFgnc/T6ZuSeASSOI/AAAAAAAABaA/trWICcMseo8/2012-05-06_20.21.34.png
http://lh3.googleusercontent.com/-eeazkQ71ngA/T6ZuV06dGOI/AAAAAAAABaI/ztr5ngTlhpM/2012-05-06_20.25.42.png
http://lh4.googleusercontent.com/-lI1tPh8CO_0/T6ZuZH_pxiI/AAAAAAAABaQ/RmbJRdSpj70/2012-05-06_20.26.56.png
[None, None]
Traceback (most recent call last):
File "buzz2weibo.py", line 175, in
if post2weibo(api, act):
File "buzz2weibo.py", line 87, in post2weibo
imagefile = catimages(imagefiles)
File "buzz2weibo.py", line 60, in catimages
result_img.save(imagefile)
File "/usr/lib/python2.6/site-packages/PIL/Image.py", line 1405, in save
save_handler(self, fp, filename)
File "/usr/lib/python2.6/site-packages/PIL/JpegImagePlugin.py", line 409, in _save
ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
File "/usr/lib/python2.6/site-packages/PIL/ImageFile.py", line 487, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File "/usr/lib/python2.6/site-packages/PIL/Image.py", line 391, in _getencoder
raise IOError("encoder %s not available" % encoder_name)
IOError: encoder jpeg not available


the Error occurs when post have multi-pictures

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.