Zend_Service_Audioscrobbler.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.audioscrobbler">
  4. <title>Zend_Service_Audioscrobbler</title>
  5. <sect2 id="zend.service.audioscrobbler.introduction">
  6. <title>Introduction</title>
  7. <para>
  8. <classname>Zend_Service_Audioscrobbler</classname> is a simple API for using the Audioscrobbler REST Web Service. The
  9. Audioscrobbler Web Service provides access to its database of Users, Artists, Albums, Tracks, Tags, Groups,
  10. and Forums. The methods of the <classname>Zend_Service_Audioscrobbler</classname> class begin with one of these terms.
  11. The syntax and namespaces of the Audioscrobbler Web Service are mirrored in
  12. <classname>Zend_Service_Audioscrobbler</classname>. For more information about the Audioscrobbler REST Web Service,
  13. please visit the <ulink url="http://www.audioscrobbler.net/data/webservices/">Audioscrobbler Web Service
  14. site</ulink>.
  15. </para>
  16. </sect2>
  17. <sect2 id="zend.service.audioscrobbler.users">
  18. <title>Users</title>
  19. <para>
  20. In order to retrieve information for a specific user, the <code>setUser()</code> method is first used to
  21. select the user for which data are to be retrieved. <classname>Zend_Service_Audioscrobbler</classname> provides
  22. several methods for retrieving data specific to a single user:
  23. <itemizedlist>
  24. <listitem>
  25. <para>
  26. <code>userGetProfileInformation()</code>: Returns a SimpleXML object containing the current
  27. user's profile information.
  28. </para>
  29. </listitem>
  30. <listitem>
  31. <para>
  32. <code>userGetTopArtists()</code>: Returns a SimpleXML object containing a list of the current
  33. user's most listened to artists.
  34. </para>
  35. </listitem>
  36. <listitem>
  37. <para>
  38. <code>userGetTopAlbums()</code>: Returns a SimpleXML object containing a list of the current
  39. user's most listened to albums.
  40. </para>
  41. </listitem>
  42. <listitem>
  43. <para>
  44. <code>userGetTopTracks()</code>: Returns a SimpleXML object containing a list of the current
  45. user's most listened to tracks.
  46. </para>
  47. </listitem>
  48. <listitem>
  49. <para>
  50. <code>userGetTopTags()</code>: Returns a SimpleXML object containing a list of tags most applied
  51. by the current user.
  52. </para>
  53. </listitem>
  54. <listitem>
  55. <para>
  56. <code>userGetTopTagsForArtist()</code>: Requires that an artist be set via
  57. <code>setArtist()</code>. Returns a SimpleXML object containing the tags most applied to the
  58. current artist by the current user.
  59. </para>
  60. </listitem>
  61. <listitem>
  62. <para>
  63. <code>userGetTopTagsForAlbum()</code>: Requires that an album be set via
  64. <code>setAlbum()</code>. Returns a SimpleXML object containing the tags most applied to the
  65. current album by the current user.
  66. </para>
  67. </listitem>
  68. <listitem>
  69. <para>
  70. <code>userGetTopTagsForTrack()</code>: Requires that a track be set via
  71. <code>setTrack()</code>. Returns a SimpleXML object containing the tags most applied to the
  72. current track by the current user.
  73. </para>
  74. </listitem>
  75. <listitem>
  76. <para>
  77. <code>userGetFriends()</code>: Returns a SimpleXML object containing the user names of the
  78. current user's friends.
  79. </para>
  80. </listitem>
  81. <listitem>
  82. <para>
  83. <code>userGetNeighbours()</code>: Returns a SimpleXML object containing the user names of
  84. people with similar listening habits to the current user.
  85. </para>
  86. </listitem>
  87. <listitem>
  88. <para>
  89. <code>userGetRecentTracks()</code>: Returns a SimpleXML object containing the 10 tracks most
  90. recently played by the current user.
  91. </para>
  92. </listitem>
  93. <listitem>
  94. <para>
  95. <code>userGetRecentBannedTracks()</code>: Returns a SimpleXML object containing a list of the 10
  96. tracks most recently banned by the current user.
  97. </para>
  98. </listitem>
  99. <listitem>
  100. <para>
  101. <code>userGetRecentLovedTracks()</code>: Returns a SimpleXML object containing a list of the 10
  102. tracks most recently loved by the current user.
  103. </para>
  104. </listitem>
  105. <listitem>
  106. <para>
  107. <code>userGetRecentJournals()</code>: Returns a SimpleXML object containing a list of the
  108. current user's most recent journal entries.
  109. </para>
  110. </listitem>
  111. <listitem>
  112. <para>
  113. <code>userGetWeeklyChartList()</code>: Returns a SimpleXML object containing a list of weeks for
  114. which there exist Weekly Charts for the current user.
  115. </para>
  116. </listitem>
  117. <listitem>
  118. <para>
  119. <code>userGetRecentWeeklyArtistChart()</code>: Returns a SimpleXML object containing the most
  120. recent Weekly Artist Chart for the current user.
  121. </para>
  122. </listitem>
  123. <listitem>
  124. <para>
  125. <code>userGetRecentWeeklyAlbumChart()</code>: Returns a SimpleXML object containing the most
  126. recent Weekly Album Chart for the current user.
  127. </para>
  128. </listitem>
  129. <listitem>
  130. <para>
  131. <code>userGetRecentWeeklyTrackChart()</code>: Returns a SimpleXML object containing the most
  132. recent Weekly Track Chart for the current user.
  133. </para>
  134. </listitem>
  135. <listitem>
  136. <para>
  137. <code>userGetPreviousWeeklyArtistChart($fromDate, $toDate)</code>: Returns a SimpleXML object
  138. containing the Weekly Artist Chart from <code>$fromDate</code> to <code>$toDate</code> for the
  139. current user.
  140. </para>
  141. </listitem>
  142. <listitem>
  143. <para>
  144. <code>userGetPreviousWeeklyAlbumChart($fromDate, $toDate)</code>: Returns a SimpleXML object
  145. containing the Weekly Album Chart from <code>$fromDate</code> to <code>$toDate</code> for the
  146. current user.
  147. </para>
  148. </listitem>
  149. <listitem>
  150. <para>
  151. <code>userGetPreviousWeeklyTrackChart($fromDate, $toDate)</code>: Returns a SimpleXML object
  152. containing the Weekly Track Chart from <code>$fromDate</code> to <code>$toDate</code> for the
  153. current user.
  154. </para>
  155. </listitem>
  156. </itemizedlist>
  157. </para>
  158. <example id="zend.service.audioscrobbler.users.example.profile_information">
  159. <title>Retrieving User Profile Information</title>
  160. <para>
  161. In this example, we use the <code>setUser()</code> and <code>userGetProfileInformation()</code> methods
  162. to retrieve a specific user's profile information:
  163. </para>
  164. <programlisting language="php"><![CDATA[
  165. $as = new Zend_Service_Audioscrobbler();
  166. // Set the user whose profile information we want to retrieve
  167. $as->setUser('BigDaddy71');
  168. // Retrieve BigDaddy71's profile information
  169. $profileInfo = $as->userGetProfileInformation();
  170. // Display some of it
  171. print "Information for $profileInfo->realname "
  172. . "can be found at $profileInfo->url";
  173. ]]></programlisting>
  174. </example>
  175. <example id="zend.service.audioscrobbler.users.example.weekly_artist_chart">
  176. <title>Retrieving a User's Weekly Artist Chart</title>
  177. <programlisting language="php"><![CDATA[
  178. $as = new Zend_Service_Audioscrobbler();
  179. // Set the user whose profile weekly artist chart we want to retrieve
  180. $as->setUser('lo_fye');
  181. // Retrieves a list of previous weeks for which there are chart data
  182. $weeks = $as->userGetWeeklyChartList();
  183. if (count($weeks) < 1) {
  184. echo 'No data available';
  185. }
  186. sort($weeks); // Order the list of weeks
  187. $as->setFromDate($weeks[0]); // Set the starting date
  188. $as->setToDate($weeks[0]); // Set the ending date
  189. $previousWeeklyArtists = $as->userGetPreviousWeeklyArtistChart();
  190. echo 'Artist Chart For Week Of '
  191. . date('Y-m-d h:i:s', $as->from_date)
  192. . '<br />';
  193. foreach ($previousWeeklyArtists as $artist) {
  194. // Display the artists' names with links to their profiles
  195. print '<a href="' . $artist->url . '">' . $artist->name . '</a><br />';
  196. }
  197. ]]></programlisting>
  198. </example>
  199. </sect2>
  200. <sect2 id="zend.service.audioscrobbler.artists">
  201. <title>Artists</title>
  202. <para>
  203. <classname>Zend_Service_Audioscrobbler</classname> provides several methods for retrieving data about a specific
  204. artist, specified via the <code>setArtist()</code> method:
  205. <itemizedlist>
  206. <listitem>
  207. <para>
  208. <code>artistGetRelatedArtists()</code>: Returns a SimpleXML object containing a list of
  209. Artists similar to the current Artist.
  210. </para>
  211. </listitem>
  212. <listitem>
  213. <para>
  214. <code>artistGetTopFans()</code>: Returns a SimpleXML object containing a list of Users who
  215. listen most to the current Artist.
  216. </para>
  217. </listitem>
  218. <listitem>
  219. <para>
  220. <code>artistGetTopTracks()</code>: Returns a SimpleXML object containing a list of the current
  221. Artist's top-rated Tracks.
  222. </para>
  223. </listitem>
  224. <listitem>
  225. <para>
  226. <code>artistGetTopAlbums()</code>: Returns a SimpleXML object containing a list of the current
  227. Artist's top-rated Albums.
  228. </para>
  229. </listitem>
  230. <listitem>
  231. <para>
  232. <code>artistGetTopTags()</code>: Returns a SimpleXML object containing a list of the Tags most
  233. frequently applied to current Artist.
  234. </para>
  235. </listitem>
  236. </itemizedlist>
  237. </para>
  238. <example id="zend.service.audioscrobbler.artists.example.related_artists">
  239. <title>Retrieving Related Artists</title>
  240. <programlisting language="php"><![CDATA[
  241. $as = new Zend_Service_Audioscrobbler();
  242. // Set the artist for whom you would like to retrieve related artists
  243. $as->setArtist('LCD Soundsystem');
  244. // Retrieve the related artists
  245. $relatedArtists = $as->artistGetRelatedArtists();
  246. foreach ($relatedArtists as $artist) {
  247. // Display the related artists
  248. print '<a href="' . $artist->url . '">' . $artist->name . '</a><br />';
  249. }
  250. ]]></programlisting>
  251. </example>
  252. </sect2>
  253. <sect2 id="zend.service.audioscrobbler.tracks">
  254. <title>Tracks</title>
  255. <para>
  256. <classname>Zend_Service_Audioscrobbler</classname> provides two methods for retrieving data specific to a single
  257. track, specified via the <code>setTrack()</code> method:
  258. <itemizedlist>
  259. <listitem>
  260. <para>
  261. <code>trackGetTopFans()</code>: Returns a SimpleXML object containing a list of Users who
  262. listen most to the current Track.
  263. </para>
  264. </listitem>
  265. <listitem>
  266. <para>
  267. <code>trackGetTopTags()</code>: Returns a SimpleXML object containing a list of the Tags most
  268. frequently applied to the current Track.
  269. </para>
  270. </listitem>
  271. </itemizedlist>
  272. </para>
  273. </sect2>
  274. <sect2 id="zend.service.audioscrobbler.tags">
  275. <title>Tags</title>
  276. <para>
  277. <classname>Zend_Service_Audioscrobbler</classname> provides several methods for retrieving data specific to a single
  278. tag, specified via the <code>setTag()</code> method:
  279. <itemizedlist>
  280. <listitem>
  281. <para>
  282. <code>tagGetOverallTopTags()</code>: Returns a SimpleXML object containing a list of Tags most
  283. frequently used on Audioscrobbler.
  284. </para>
  285. </listitem>
  286. <listitem>
  287. <para>
  288. <code>tagGetTopArtists()</code>: Returns a SimpleXML object containing a list of Artists to whom
  289. the current Tag was most frequently applied.
  290. </para>
  291. </listitem>
  292. <listitem>
  293. <para>
  294. <code>tagGetTopAlbums()</code>: Returns a SimpleXML object containing a list of Albums to which
  295. the current Tag was most frequently applied.
  296. </para>
  297. </listitem>
  298. <listitem>
  299. <para>
  300. <code>tagGetTopTracks()</code>: Returns a SimpleXML object containing a list of Tracks to which
  301. the current Tag was most frequently applied.
  302. </para>
  303. </listitem>
  304. </itemizedlist>
  305. </para>
  306. </sect2>
  307. <sect2 id="zend.service.audioscrobbler.groups">
  308. <title>Groups</title>
  309. <para>
  310. <classname>Zend_Service_Audioscrobbler</classname> provides several methods for retrieving data specific to a single
  311. group, specified via the <code>setGroup()</code> method:
  312. <itemizedlist>
  313. <listitem>
  314. <para>
  315. <code>groupGetRecentJournals()</code>: Returns a SimpleXML object containing a list of recent
  316. journal posts by Users in the current Group.
  317. </para>
  318. </listitem>
  319. <listitem>
  320. <para>
  321. <code>groupGetWeeklyChart()</code>: Returns a SimpleXML object containing a list of weeks for
  322. which there exist Weekly Charts for the current Group.
  323. </para>
  324. </listitem>
  325. <listitem>
  326. <para>
  327. <code>groupGetRecentWeeklyArtistChart()</code>: Returns a SimpleXML object containing the most
  328. recent Weekly Artist Chart for the current Group.
  329. </para>
  330. </listitem>
  331. <listitem>
  332. <para>
  333. <code>groupGetRecentWeeklyAlbumChart()</code>: Returns a SimpleXML object containing the most
  334. recent Weekly Album Chart for the current Group.
  335. </para>
  336. </listitem>
  337. <listitem>
  338. <para>
  339. <code>groupGetRecentWeeklyTrackChart()</code>: Returns a SimpleXML object containing the most
  340. recent Weekly Track Chart for the current Group.
  341. </para>
  342. </listitem>
  343. <listitem>
  344. <para>
  345. <code>groupGetPreviousWeeklyArtistChart($fromDate, $toDate)</code>: Requires
  346. <code>setFromDate()</code> and <code>setToDate()</code>. Returns a SimpleXML object containing
  347. the Weekly Artist Chart from the current fromDate to the current toDate for the current Group.
  348. </para>
  349. </listitem>
  350. <listitem>
  351. <para>
  352. <code>groupGetPreviousWeeklyAlbumChart($fromDate, $toDate)</code>: Requires
  353. <code>setFromDate()</code> and <code>setToDate()</code>. Returns a SimpleXML object containing
  354. the Weekly Album Chart from the current fromDate to the current toDate for the current Group.
  355. </para>
  356. </listitem>
  357. <listitem>
  358. <para>
  359. <code>groupGetPreviousWeeklyTrackChart($fromDate, $toDate)</code>: Returns a SimpleXML object
  360. containing the Weekly Track Chart from the current fromDate to the current toDate for the
  361. current Group.
  362. </para>
  363. </listitem>
  364. </itemizedlist>
  365. </para>
  366. </sect2>
  367. <sect2 id="zend.service.audioscrobbler.forums">
  368. <title>Forums</title>
  369. <para>
  370. <classname>Zend_Service_Audioscrobbler</classname> provides a method for retrieving data specific to a single forum,
  371. specified via the <code>setForum()</code> method:
  372. <itemizedlist>
  373. <listitem>
  374. <para>
  375. <code>forumGetRecentPosts()</code>: Returns a SimpleXML object containing a list of recent posts
  376. in the current forum.
  377. </para>
  378. </listitem>
  379. </itemizedlist>
  380. </para>
  381. </sect2>
  382. </sect1>
  383. <!--
  384. vim:se ts=4 sw=4 et:
  385. -->