Пример #1
0
        attachment =  {
                 'name': 'vtcsec bot',
                 'link': src,
                 'caption': 'vtcsec bot likes this',
                 'description': text,
                 'picture': pic
                 }

    return ("""
        %s (@%s, %s)
    """ % (text,author,src), attachment)

while True:
    print 'retweeting..'
    try:
        tweets = tbot.auto_rt_user_popular('_conorpp',count=4)
        tbot.sync_follows()
        #tweets = [{'text':'RT @_conorpp: rab fdewfhewo http://example.com'}]
        for i in tweets:
            text = i['retweeted_status']['text']
            #if '@' in text:
            #    continue
            tbot.print_tweet(i)
            post, pic = build_fb_post(i)
            print('posted to facebook: ', post)

            if pic: 
                fbot.api.put_wall_post(post, attachment=pic)
                print ('posted media', pic['picture'])
            else: fbot.api.put_wall_post(post)