æè¿ã¯Scalaãåå¼·ãã¦ããã
ã³ããæ¬ã6å²ãããèªãã ã å人çã«ã³ããæ¬ã¯èªã¿ã«ãããä¸å¯§ã§ç¶²ç¾ çãªè§£èª¬ã¯ããããããã ãã©ãã
ã¡ãã£ã¨ããã³ã¼ãæ¸ãã¦éãã§ãã ã¹ã©ã¤ãããºã«è§£ãããã°ã©ã ä½ã£ãã
ãã¨ãã¿ã¤ãã«ã®ã¨ããä»ã¯SlideShareã®Web APIãScalaã§ä½¿ããããããã©ã¤ãã©ãªãä½ã£ã¦ããã¾ã ãã¼ã¯ã¼ãã«ããæ¤ç´¢æ©è½ãããªããã©ã©ãã©ã追å ãã¦ããäºå®ãä¸æãªã³ã¼ãããã£ããããã³ãã§ãã ããï¼ ã¡ãªã¿ã«æ¢ã«Javaã§æ¸ãããã©ã¤ãã©ãªãããããããã ãã©ãã¼ã¯ã¼ãæ¤ç´¢æ©è½ããªãã
ãã®ãã¡Scalaã¨Kotlinã®æ¯è¼è¨äºæ¸ãã
追è¨[2013-09-08]
SlideShareã®Web APIã«ã¤ãã¦
SlideShareã®Web APIã¯æ¯è¼çæ±ããããã¨æããã§ããªã¯ã¨ã¹ãã®æã«UNIXæå»ã¨ãã®SHA-1ããã·ã¥å¤ã渡ããªããã°ãªããªãã®ã¯ã¡ãã£ã¨é¢åããã
ããããã¹ã©ã¤ãã®ãã¼ã¯ã¼ãæ¤ç´¢ã¨ãã®ä»ã®æ¤ç´¢ã®APIã§ãã¼ã¸ã³ã°ã®ãã©ã¡ã¼ã¿ãç°ãªãã®ãæ°æã¡æªãããã¼ã¯ã¼ãæ¤ç´¢ã®å ´åã¯
- itemsPerPage
- page
ã§ããã®ä»ã®æ¤ç´¢ã®å ´åã¯
- limit
- offset
ã¨å¾®å¦ã«éã£ã¦ãã
SlideShare4Sã¯ãããªå·®ç°ãå¸åãã¦ãããããUNIXæå»ã®ããã·ã¥ã¨ãããã£ã¦ããããã便å©ã ãï¼
SlideShare4S ãµã³ãã«ã³ã¼ã
val apiKey = "YOUR_API_KEY" val sharedSecret = "YOUR_SHARED_SECRET" val ss = SlideShare4S(apiKey, sharedSecret)
å¤æ°ss
ã«ä»£å
¥ããããªãã¸ã§ã¯ããéãã¦SlideShareã®APIã«ã¢ã¯ã»ã¹ã§ãããAPI Keyã¨Shared Secretã¯åèªSlideShareããåå¾ããå¿
è¦ãããã
ã¦ã¼ã¶åããã¹ã©ã¤ããæ¤ç´¢ããå ´åã¯æ¬¡ã®ã¨ããã
val username = "ngswtaro" val paging = Paging(itemsPerPage=12, page=1) ss.getSlideshowsByUser(username, paging)
getSlideshowsByUser
ã¯Seq[Slideshow]
ãè¿ãããã¼ã¸ã³ã°ã®ããã®ãªãã¸ã§ã¯ããPaging(itemsPerPage=12, page1)
ã§ä½ã£ã¦ããã
ãã¼ã¯ã¼ãã§ã¹ã©ã¤ããæ¤ç´¢ããå ´åã¯ããã
val query = Query("scala") val paging = Paging(12, 1) ss.searchSlideshows(query, paging)
Query("scala")
ã§ãã¼ã¯ã¼ã"scala"ã§ãã£ã¦æ¤ç´¢ããã¯ã¨ãªãä½ã£ã¦ããQuery
ã«ã¯ä»ã®ãã©ã¡ã¼ã¿ï¼ã½ã¼ãé ãè¨èªãªã©ï¼ãè¨å®ã§ãããã©ãªãã·ã§ã³æ±ãã