»©¾Ñ¾Æ°¡´Â °ÍOAuth 1.0 / A, 2.0 ¹× ally ¿ë ÆÄÀ̽㠶óÀ̺귯¸® | |
Áö±Ý ´Ù¿î·Îµå |
»©¾Ñ¾Æ°¡´Â °Í ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- MIT/X Consortium Lic...
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Max Countryman
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://github.com/maxcountryman/
»©¾Ñ¾Æ°¡´Â °Í ű×
»©¾Ñ¾Æ°¡´Â °Í ¼³¸í
RATH´Â OAuth 1.0 / A, 2.0 ¹× olly ¼ÒºñÀÚ Áö¿øÀ» Á¦°øÇÕ´Ï´Ù. ÆÐÅ°Áö´Â ÈǸ¢ÇÑ Python Requests.InstallationInstallationInstallationInstall ´ÙÀ½ ¸í·É Áß Çϳª¸¦ »ç¿ëÇÏ¿© ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÕ´Ï´Ù. easy_install Rauthor PIP ¼³Ä¡ RauthExample Usage »ç¿ë ÆÐÅ°Áö°¡ ¸Å¿ì °£´ÜÇÕ´Ï´Ù. ÆÄÀ̽㠿äûÀÌ ¼³Ä¡µÇ¾î ÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ. Relavent ¸ðµâÀ» °¡Á® ¿Í¼ OAuth ¿£µå Æ÷ÀÎÆ® È°¿ëÀ» ½ÃÀÛÇϽʽÿÀ! »ç¿ëÀÚÀÇ Twitter ŸÀÓ ¶óÀÎÀ» °¡Á® °¡ÀÚ. ¼ºñ½º ÄÁÅ×ÀÌ³Ê °³Ã¼¸¦ ¸¸µé¾î ½ÃÀÛÇϽʽÿÀ. Rauth.Service °¡Á® ¿À±â OAuth1Service # ½ÇÁ¦ ¼ÒºñÀÚ Å°¸¦ °¡Á®¿À°í https//dev.twitter.com/apps/new Æ®À§ÅÍ = OAuth1Service (name = 'Twitter', Consumer_Key = 'your_consumer_key) ', consumer_secret ='your_consumer_secret ', request_token_url ='https : //api.twitter.com/oauth/request_token ', access_token_url ='https : //api.twitter.com/oauth/access_token ', authorize_url ='https : / /api.twitter.com/oauth/authorize ', header_auth = true). request_token, request_token_secret = \ twitter.get_request_token (http_method ='get ') ÀÎÁõ È帧À» Åë°úÇϽʽÿÀ. ¿ì¸®ÀÇ ¿¹´Â °£´ÜÇÑ ÄÜ¼Ö ÀÀ¿ë ÇÁ·Î±×·¥À̱⠶§¹®¿¡ Æ®À§ÅÍ´Â ÀÔ·Â ÇÒ ÇÉÀ» Á¦°øÇÕ´Ï´Ù. Authorize_URL = TWITTER.GET_AUTHORIZE_URL (request_token) Àμâ "+ Authorize_URL PIN = RAW_INPUT ( 'ºê¶ó¿ìÀú¿¡¼ PIN ENTER :') ¾×¼¼½º ÅäÅ«ÀÇ ±ÇÇÑÀÖ´Â ¿äû ÅäÅ«À» ±³È¯ÇϽʽÿÀ. ÀÀ´ä = TWITTER.GET_ACCESS_TOKEN (request_token) request_token_secret, http_method = 'get', oauth_verifier = pin) data = response.Content Access_Token = µ¥ÀÌÅÍ ±×¸®°í ÀÌÁ¦ ¿ì¸®´Â Æ®À§ÅÍ Å¸ÀÓ ¶óÀÎÀ» °¡Á®¿Ã ¼ö ÀÖ½À´Ï´Ù! params = {include_rts ': 1, # retweets count': 10} # 10 Æ®À§ÅÍ ÀÀ´ä = Twitter.Request ( 'get', 'https://api.twitter.com/1/statuses/home_timeline.json' , access_token, access_token_secret, header_auth = true, params = params) enyumerate¿¡¼ Æ®À (response.content, 1) : handle = tweet . ÀÎÄÚµù ( 'utf-8') ÅؽºÆ® = Tweet . ÀÎÄÚµù ( 'UTF-8') Àμâ '{0}. @ {1} - {2} '. Çü½Ä (i, ÇÚµé, ÅؽºÆ®) Àüü ¿¹´Â (https://github.com/litl/rauth/blob/master/examples)¿¡ ÀÖ½À´Ï´Ù. /twitter-timeline.py : Á¦Ç°ÀÇ È¨ÆäÀÌÁö
»©¾Ñ¾Æ°¡´Â °Í °ü·Ã ¼ÒÇÁÆ®¿þ¾î