Drkcore

25 11 2009 Python twitter Tweet

twitterでフォローされているか調べるスクリプト

ダイレクトメッセージを送れるかどうかで判断するみたいなつぶやきが流れてたので。

setでごにょれば良かろうと。

import twitter
api = twitter.Api(username='user',password='pass')
friends = set([u.name for u in api.GetFriends()])
followers = set([u.name for u in api.GetFollowers()])

print "follow and followed: "     + ",".join(list(friends.intersection(followers)))
print "not follow but followed: " + ",".join(list(followers.difference(friends)))
print "follow but not followed: " + ",".join(list(friends.difference(followers)))

ProductName みんなのPython 改訂版
柴田 淳
ソフトバンククリエイティブ / ¥ 2,940 ()
在庫あり。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021