Ajaxã使ããã¨ã§ãWebã®ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¤ã¹ã åçã«æ¹åãããã¨ãåºæ¥ããã ããã©ã ã¤ãã¤ãè¯ããµã³ãã«ãè¦ã¤ãããªãã£ãã®ã§JQueryã¨PHPã§å®è£ ãããµã³ãã«ãä½ã£ã¦ã¿ãã ãµã³ãã«ãè¦ã¤ãããªãçç±Ajaxã¯ãµã¼ãã¼ã¨ã¯ã©ã¤ã¢ã³ãã®é£æºã§åãã¦ããããã©ã ãµã¼ãã¼ã¯å¤ç¨®å¤æ§ãªæè¡ãããã®ã§ç¶²ç¾ ã§ããªãã ã¯ã©ã¤ã¢ã³ãå´ã ã説æããã¨ããµã¼ãã¼å´ãæããã®ã§ãã®ã¾ã¾ã§ã¯ãµã³ãã«ãåãããã¨ãåºæ¥ãªãã ã¨ãããã¨ã§ãã¿ã¼ã²ãããPHPã¨JQueryã«éå®ãã¦ãµã¼ãã¼ããã¯ã©ã¤ã¢ã³ãã¾ã§ä¸è²«ãããµã³ãã«ã«ãã¦ã¿ã¾ããã ã½ã¼ã¹ã³ã¼ãã極åã·ã³ãã«ã«ãã¦å ¨ã³ã¼ãæ²è¼ãã¦ãã¾ãã ä½ãç©ã¯ã©ã¤ã¢ã³ããããµã¼ãã¼ã«æ°å¤ãäºã¤éä¿¡ãã äºã¤ã®å¤ã足ããçµæããµã¼ãã¼ããåå¾ãã¦ç»é¢ãæ´æ°ããã ç¨æããç©PEARãåããµã¼ãã¼ä»åã¯JSONãå¦çããã®ã«PEARã®JSONã©ã¤ã
è¿é ããã¼ã¿å½¢å¼ã®ããã¨ãã«ãJSONãã使ãå ´é¢ãå¤ããªã£ã¦ãã¦ãã¾ãã PHPã®ãã¼ã¿ãç°¡åã«JSONå½¢å¼ã«å¤æããã©ã¤ãã©ãªã«ã¯ããPEAR::Services_JSONããZend/Json.phpããphp-jsonã¢ã¸ã¥ã¼ã«ãçãããã¾ãããããã®ç°¡åãªä½¿ç¨æ¹æ³ãç´¹ä»ãã¾ãã âPEAR::Services_JSONã®å ´å ç¾å¨ãã®ããã±ã¼ã¸ã¯PEARã«æ£å¼ç»é²ããã¦ãã¾ããã ãã®çºãpearã³ãã³ãã§ã¯ã¤ã³ã¹ãã¼ã«ãããã¨ãã§ãã¾ããã®ã§ã 以ä¸ã®ãã¼ã¸ãããã¦ã³ãã¼ããè¡ããè¨ç½®ãã¦ãã ããã ãã¦ã³ãã¼ã(http://mike.teczno.com/JSON.tar.gz) ãã¨ã¯ãé常ã«ç°¡åãªã³ã¼ãã§JSONå½¢å¼ã®ãã¼ã¿ã«å¤æãããã¨ãã§ãã¾ãã <?php require_once "JSON.php"; $arr = array( array( "name" =
ããã¡ã«ã¯ã@yoheiMuneã§ãã ä»æ¥ã¯ãPHPã«ããã¦JSONãªãã¸ã§ã¯ãï¼JavaScript Object Notationï¼ãæ±ãæ¹æ³ã«ã¤ãã¦èª¿ã¹ãã®ã§ã ããã°ã«æ®ãã¦ããããã¨æãã¾ãã æè¿ã®Webãµã¼ãã¹ï¼RESTãªã©ï¼ã§ã¯ãJSONãªãã¸ã§ã¯ããè¿ããµã¼ãã¹ãå¢ãããæãã¾ãã JSONã«ã¤ãã¦ã®è©³ç´°ã¯ããã¡ãï¼http://www.json.org/json-ja.htmlï¼ãåç §ãã ããã JSONã¯JavaScriptã®ãªãã¸ã§ã¯ãå½¢å¼ã¯ãXMLã«å ãã¦åãæ å ±ãå°ãªããã¼ã¿éã§ä¼ãããã¨ãåºæ¥ãã®ã§ã æè¿ã¯å¤§æ³¨ç®ã§ãï¼ï¼ åçï¼ã¯ããã»ãã©ã©ã¼ã PHPã®äºåè¨å® PHPã§JSONãªãã¸ã§ã¯ããæ±ãéã«ãPHP5.2.0以ä¸ã§ããã°ç¹ã«äºåè¨å®ã¯å¿ è¦ããã¾ãããã ãã以åã®ãã¼ã¸ã§ã³ã®å ´åã«ã¯ããphp-jsonããçµã¿è¾¼ãå¿ è¦ãããã¾ãã詳細ã¯ã以ä¸ã
ä»å¾å¿ è¦ã«ãªãã ããã¨æãTwitterã®å¤ã®åå¾æ¹æ³ã調ã¹ã¦ã¿ã¾ããã 使ç¨ããã®ã¯ãTwitterAPIã¨jQueryã§ãã TwitterAPIã®å¤ãã¿ã ã¾ããTwitterAPIã®ä¸èº«ãè¦ãã¦ã¿ããã ä¸è¨URLã®ãã¢ã«ã¦ã³ããã«èªåã®IDãå ¥ãã¦éãã¨ããã http://api.twitter.com/1/statuses/user_timeline/ã¢ã«ã¦ã³ã.json ããã£ã¨è¡¨ç¤ºããæåãTwitterAPIã®ä¸èº«ã§ãã å¤ã¯å ¨ã¦é åã«ãªã£ã¦ãã æååã®åµã ãããã¿ã¦ã¿ãã¨ãé åã«ãªã£ã¦ããã ä¾ãã°ããã âsourceâ:âwebâ,âcreated_atâ:âFri Jun 18 07:28:41 +0000 2010â³ ã¯webã§ãã¤ã¼ããã¦ãã®æéã表ããã¦ãã¾ãã ã§ãã®ã§ãä¸èº«ã¯ç°¡åã«ç解ã§ããã¨æãã¾ãã $.getJSONã§TwitterAPIã®å¤ã
Twitter API 1.1ã§åå¾ãããä»»æã®ã¦ã¼ã¶ã¼ã®ã¿ã¤ã ã©ã¤ã³ï¼JSONãã¼ã¿ï¼ããAtomãã£ã¼ããä½æããæ¹æ³ãç´¹ä»ãã¾ãã Twitter API 1.1ã§åå¾ããJSONãAtomã«å¤æãããµã³ãã« ï¼ï¼Twitterã¢ããªã±ã¼ã·ã§ã³ã®ä½æ Twitterã¢ããªã±ã¼ã·ã§ã³éçºã®ãã¼ã¸ãéããTwitterã®ã¢ã«ã¦ã³ãã§ãµã¤ã³ã¤ã³ã å³ä¸ã«ãããCreate a new applicationããã¯ãªãã¯ã ãApplication Detailsãã®NameãDescriptionãWebsiteãè¨å®ãCallback URLã®è¨å®ã¯ä¸è¦ã§ãã ä¸ã®æ¹ã«ãããYes, I agreeãããã§ãã¯ããCAPTHCAãå ¥åãã¦ãCreate your Twitter applicationããã¯ãªãã¯ã 次ã®ç»é¢ã®ä¸ã«ãããCreate my access tokenããã¯ãª
JSON (JavaScript Object Notation)ã¯ã軽éã®ãã¼ã¿äº¤æãã©ã¼ãããã§ãã人éã«ã¨ã£ã¦èªã¿æ¸ãã容æã§ããã·ã³ã«ã¨ã£ã¦ãç°¡åã«ãã¼ã¹ãçæãè¡ãªããå½¢å¼ã§ãã JavaScriptããã°ã©ãã³ã°è¨èª ï¼ECMA-262æ¨æºç¬¬3ç 1999å¹´12æï¼ã®ä¸é¨ããã¼ã¹ã«ä½ããã¦ãã¾ãã JSONã¯å®å ¨ã«è¨èªããç¬ç«ããããã¹ãå½¢å¼ã§ãããCãC++ãC#ãJavaãJavaScriptãPerlãPythonããã®ä»å¤ãã®Cãã¡ããªã¼ã®è¨èªã使ç¨ããããã°ã©ãã«ã¨ã£ã¦ã¯ã馴æã¿æ·±ãè¦ç´ã使ããã¦ãã¾ãããããã®æ§è³ªãã JSONãçæ³çãªãã¼ã¿äº¤æè¨èªã«ãã¦ãã¾ãã JSONã¯2ã¤ã®æ§é ãåºã«ãã¦ãã¾ãã åå/å¤ã®ãã¢ã®éã¾ããæ§ã ãªè¨èªã§ãããã¯ãªãã¸ã§ã¯ããã¬ã³ã¼ããæ§é ä½ããã£ã¯ã·ã§ããªãããã·ã¥ãã¼ãã«ããã¼ã®ãããªã¹ããé£æ³é åã¨ãã¦å®ç¾ããã¦ãã¾ãã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}