ããã° ãã¹ã¯ã¼ãèªè¨¼ é²è¦§ããã«ã¯ç®¡ç人ãè¨å®ãã ãã¹ã¯ã¼ãã®å ¥åãå¿ è¦ã§ãã 管ç人ããã®ã¡ãã»ã¼ã¸ é²è¦§ãã¹ã¯ã¼ã Copyright © since 1999 FC2 inc. All Rights Reserved.
ããã° ãã¹ã¯ã¼ãèªè¨¼ é²è¦§ããã«ã¯ç®¡ç人ãè¨å®ãã ãã¹ã¯ã¼ãã®å ¥åãå¿ è¦ã§ãã 管ç人ããã®ã¡ãã»ã¼ã¸ é²è¦§ãã¹ã¯ã¼ã Copyright © since 1999 FC2 inc. All Rights Reserved.
pythonããtwitterã«æ稿ããããã®ã¢ã¸ã¥ã¼ã«ã¯ï¼ã¤ããï¼ python-twitterã¨tweepyã ï¼ python-twitterã主æµã ãï¼ä½¿ãå§ããå½æpython-twitterã®OAuthèªè¨¼ã®ããã¥ã¡ã³ãããªãã¦tweepyãå©ç¨ãã¦ããï¼ ããã§tweepyã®ç´¹ä»ãããï¼ TLããåå¾ ã¾ãã¯ç°¡åãªAPIãå©ãã¦è¦ãï¼ import tweepy tl = tweepy.api.public_timeline() print tl[0].text() tlã«ã¯ãªãã¸ã§ã¯ãã«ãªã£ã¦ããã®ã§textã§å¼ã³åºããªããã°ãªããªãï¼ userStatus import tweepy id = "hoge" # ããã¯ã¦ã¼ã¶ãã¼ã ãID usr = tweepy.api.get_user(id) print usr.description #ããã¯ãããã£ã¼ã«ãåå¾ã§ããï¼
ã¯ããã« æ¯å»è ã®å¾ ã¡æéãæã ã£ãã®ã§ã»ã»ã» ãéã³æè¦ã§ãã¤ãã¿ã¼ã®ãã¬ã³ããåå¾ãããã®ãèãã¦ã¿ã¾ããã ä»åãtweepyã使ãã¾ããã æ¬é¡ #!/usr/bin/env python # -*- coding:utf-8 -*- import tweepy import sys def get_oauth(): consumer_key = '' consumer_secret = '' access_key = '' access_secret = '' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret) return auth def get_trends(api, woeid): trend = api.tre
2011å¹´7æ24æ¥ãããã¢ããã°ãã¬ãæ¾éã¯çµäºãããã¸ã¿ã«æ¾éã«ç§»è¡ããããã§ãã twitterãããã¤ãããã¯ç¥ããªããã©Basicèªè¨¼ãçµäºããOAuthèªè¨¼ã«ç§»è¡ããããã§ããï¼ å¤§å¤ã§ããï¼ï¼ ç¾å¨ç§ãä½ã£ãtwitter-bot@Korokã§ãããtwitterã¨è©±ã¯python-twitterã§ã¤ãã¦ãã¾ããpython-twitterã¯ã©ãããBasicèªè¨¼ããããããªããæ´æ°ããã£ã¦ãªãã¿ããã ããid:tohaeã¡ãããOAuth対å¿ã¯ããããæ¹ããããã£ã¦äºãããã¡ãã£ã¡ãã¨ãã£ã¡ããã¾ãããã 使ç¨ããã©ã¤ãã©ãªã¯tweepyã å ¬å¼ : GitHub Pages · File Not Found · GitHub ããã¥ã¡ã³ã : GitHub Pages · File Not Found · GitHub åèã«ããã¨ã³ã㪠: Twitterã®botãOA
Twitterãããªã¢ã«ã¿ã¤ã ã«Tweetãåä¿¡ã§ããStreaming APIã試ãã¦ã¿ã Pythonããå©ç¨ããããã«ãTwitterç¨ã©ã¤ãã©ãªã®tweepyãã¤ã³ã¹ãã¼ã«ãã # easy_install tweepy ãã®tweepyã®Streamç¨APIçµç±ã§ãTwitterã®Streaming APIãå©ç¨ã㦠Public TLããæ¥æ¬èªã ãã®Tweetãåãåºãã¦ã¿ãã # -*- coding: utf-8 -*- import sys import tweepy import re Q = sys.argv[1:] class CustomStreamListener(tweepy.StreamListener): def on_status(self, status): try: # æ¼¢åãã²ãããªãã«ã¿ã«ããä¸æåã§ãããã°ç°¡æçã«æ¥æ¬èªã®TLã¨ãã if(re
twitterã®ããã«æ´æ°é »åº¦ãé«ããµã¼ãã¹ã®APIã¯ãã¼ãªã³ã°ã¨ãã¾ãç¸æ§ãããããã¾ãããã©ããtwitter API使ãããã°ã©ã æ¸ããªãããªã¢ã«ã¿ã¤ã ãªã¤ãã³ããã¼ã¹ã£ã½ãAPIã®æ¹ãè²ã ã¨é½åãè¯ãã®ã§èª¿ã¹ã¦ã¿ã¾ããããªãã¨ãªãXMPPã«å¯¾å¿ãã¦ãæ°ããã¦ããã§ãããå®éã¯Streaming APIã¨ããç¬èªã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãç¨æããã¦ãã¾ããã Streaming APIèªä½ã¯ãã ã®HTTPãªã¯ã¨ã¹ãã§ããªã¯ã¨ã¹ãã®ã³ãã¯ã·ã§ã³ãå¼µãã£ã±ãªãã«ãã¦ãé½åº¦ãã¼ã¿ãæµãã¦ããæ§ãªå½¢ã«ãªãã¾ããè¦ãããã«ç¸æ§ãè¯ããããªã®ã§generatorã§æ¸ãã¦ã¿ã¾ããããã®ä¾ã§ã¯å¹¾ã¤ã種é¡ãããStreaming APIã®ä¸ããfilterã使ã£ã¦ãã¾ãã #!/usr/bin/python # -*- coding: utf-8 -*- import sys import base64 i
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}