[MANUAL] English:
[zend.git] / documentation / manual / ru / module_specs / Zend_Service_Flickr.xml
blobb7e3ca4858f78cf9c7568e76b1b2c63ab4bd1e0e
1 <sect1 id="zend.service.flickr">
2     <title>Zend_Service_Flickr</title>
3     <sect2 id="zend.service.flickr.introduction">
4         <title>Введение</title>
5         <para>
6             <code>Zend_Service_Flickr</code> является простым API для
7             использования веб-вервиса Flickr. Чтобы использовать
8             веб-вервисы Flickr, вы должны иметь ключ к API. Для того, чтобы
9             получить ключ и больше информации о сервисе Flickr, обратитесь
10             к <ulink url="http://www.flickr.com/services/api/">документации по
11             API веб-вервиса Flickr</ulink>.
12         </para>
13         <para>
14             В следующем примере мы используем метод <code>tagSearch()</code>
15             для поиска фотографий со словом "php" в тегах.
16         </para>
17         <example>
18             <title>Простой поиск фотографий в Flickr</title>
19             <programlisting language="php"><![CDATA[<?php
20 require_once 'Zend/Service/Flickr.php';
22 $flickr = new Zend_Service_Flickr('MY_API_KEY');
24 $results = $flickr->tagSearch("php");
26 foreach ($results as $result) {
27     echo $result->title . '<br />';
28 }]]>
29             </programlisting>
30         </example>
31         <note>
32             <title>Опциональный параметр</title>
33             <para>
34                 <code>tagSearch()</code> принимает массив опций как второй опциональный параметр.
35             </para>
36         </note>
37     </sect2>
38     <sect2 id="zend.service.flickr.finding-users">
39         <title>Поиск фотографий и информации о пользователе Flickr</title>
40         <para>
41             <code>Zend_Service_Flickr</code> предоставляет несколько
42             способов получения информации о пользователях Flickr:
43         </para>
44         <itemizedlist>
45             <listitem>
46                 <para>
47                     <code>userSearch()</code>: Принимает строку запроса,
48                     состоящую из разделенных пробелами тегов, массив опций
49                     поиска как опциональный второй параметр и возвращает
50                     набор фотографий в виде объекта
51                     <code>Zend_Service_Flickr_ResultSet</code>.
52                 </para>
53             </listitem>
54             <listitem>
55                 <para>
56                     <code>getIdByUsername()</code>: Возвращает ID
57                     пользователя, связанного с данным именем.
58                 </para>
59             </listitem>
60             <listitem>
61                 <para>
62                     <code>getIdByEmail()</code>: Возвращает ID пользователя,
63                     связанного с данным e-mail адресом.
64                 </para>
65             </listitem>
66         </itemizedlist>
67         <example>
68             <title>Поиск открытых фотографий пользователя по адресу e-mail</title>
69             <para>
70                 В этом примере мы, имея e-mail пользователя Flickr, ищем его
71                 открытые фотографии, используя метод <code>userSearch()</code>:
72             </para>
73             <programlisting language="php"><![CDATA[<?php
74 require_once 'Zend/Service/Flickr.php';
76 $flickr = new Zend_Service_Flickr('MY_API_KEY');
78 $results = $flickr->userSearch($userEmail);
80 foreach ($results as $result) {
81     echo $result->title . '<br />';
82 }]]>
83             </programlisting>
84         </example>
85     </sect2>
86     <sect2 id="zend.service.flickr.grouppoolgetphotos">
87         <title>Поиск фотографий из пула группы</title>
88         <para>
89             <code>Zend_Service_Flickr</code> позволяет извлекать фотографии из
90             пула группы (group's pool), используя ID группы. Используйте метод
91             <code>groupPoolGetPhotos()</code>:
92         </para>
93         <example id="zend.service.flickr.grouppoolgetphotos.example-1">
94             <title>Извлечение фотографий из пула группы через ID группы</title>
95             <programlisting language="php"><![CDATA[<?php
96     require_once 'Zend/Service/Flickr.php';
98     $flickr = new Zend_Service_Flickr('MY_API_KEY');
100     $results = $flickr->groupPoolGetPhotos($groupId);
102     foreach ($results as $result) {
103         echo $result->title . '<br />';
104     }]]>
105             </programlisting>
106         </example>
107         <note>
108             <title>Опциональный параметр</title>
109             <para>
110                 <code>groupPoolGetPhotos()</code> принимает массив опций как  опциональный второй параметр.
111             </para>
112         </note>
113     </sect2>
114     <sect2 id="zend.service.flickr.getimagedetails">
115         <title>Извлечение данных по изображению в Flickr</title>
116         <para>
117             <code>Zend_Service_Flickr</code> делает быстрым и легким получение
118             данных по изображению через его ID. Просто используйте метод
119             <code>getImageDetails()</code>, как показано в следующем примере:
120         </para>
121         <example>
122             <title>Получение данных по изображению в Flickr</title>
123             <para>
124                 Имея ID изображения, легко извлечь информацию об этом
125                 изображении:
126             </para>
127             <programlisting language="php"><![CDATA[<?php
128 require_once 'Zend/Service/Flickr.php';
130 $flickr = new Zend_Service_Flickr('MY_API_KEY');
132 $image = $flickr->getImageDetails($imageId);
134 echo "Image ID $imageId is $image->width x $image->height pixels.<br />\n";
135 echo "<a href=\"$image->clickUri\">Click for Image</a>\n";]]>
136             </programlisting>
137         </example>
138     </sect2>
139     <sect2 id="zend.service.flickr.classes">
140         <title>Классы результатов Zend_Service_Flickr</title>
141         <para>
142             Объекты следующих классов возвращаются методами
143             <code>tagSearch()</code> и <code>userSearch()</code>:
144             <itemizedlist>
145                 <listitem>
146                     <para>
147                         <link linkend="zend.service.flickr.classes.resultset"><code>Zend_Service_Flickr_ResultSet</code></link>
148                     </para>
149                 </listitem>
150                 <listitem>
151                     <para>
152                         <link linkend="zend.service.flickr.classes.result"><code>Zend_Service_Flickr_Result</code></link>
153                     </para>
154                 </listitem>
155                 <listitem>
156                     <para>
157                         <link linkend="zend.service.flickr.classes.image"><code>Zend_Service_Flickr_Image</code></link>
158                     </para>
159                 </listitem>
160             </itemizedlist>
161         </para>
162         <sect3 id="zend.service.flickr.classes.resultset">
163             <title>Zend_Service_Flickr_ResultSet</title>
164             <para>Представляет набор результатов поиска, возвращенных Flickr</para>
165             <note>
166                 <para>
167                     Реализует интерфейс <code>SeekableIterator</code> для легкой
168                     итерации (например, с использованием <code>foreach</code>) и
169                     прямого доступа с помощью метода <code>seek()</code>.
170                 </para>
171             </note>
172             <sect4 id="zend.service.flickr.classes.resultset.properties">
173                 <title>Свойства класса</title>
174                 <table>
175                     <title>Свойства класса Zend_Service_Flickr_ResultSet</title>
176                     <tgroup cols="3">
177                         <thead>
178                             <row>
179                                 <entry>Имя</entry>
180                                 <entry>Тип</entry>
181                                 <entry>Описание</entry>
182                             </row>
183                         </thead>
184                         <tbody>
185                             <row>
186                                 <entry>totalResultsAvailable</entry>
187                                 <entry>int</entry>
188                                 <entry>Общее количество доступных результатов</entry>
189                             </row>
190                             <row>
191                                 <entry>totalResultsReturned</entry>
192                                 <entry>int</entry>
193                                 <entry>Общее количество возвращенных результатов</entry>
194                             </row>
195                             <row>
196                                 <entry>firstResultPosition</entry>
197                                 <entry>int</entry>
198                                 <entry>Смещение для данного набора в общем наборе результатов</entry>
199                             </row>
200                         </tbody>
201                     </tgroup>
202                 </table>
203             </sect4>
204             <sect4 id="zend.service.flickr.classes.resultset.totalResults">
205                 <title>Zend_Service_Flickr_ResultSet::totalResults()</title>
206                 <para>
207                     <methodsynopsis>
208                         <type>int</type>
209                         <methodname>totalResults</methodname>
210                         <void />
211                     </methodsynopsis>
212                 </para>
213                 <para>
214                     Возвращает общее количество результатов в наборе.
215                 </para>
216                 <para>
217                     <link linkend="zend.service.flickr.classes">Назад к списку классов</link>
218                 </para>
219             </sect4>
220         </sect3>
221         <sect3 id="zend.service.flickr.classes.result">
222             <title>Zend_Service_Flickr_Result</title>
223             <para>
224                 Отдельный результат запроса к Flickr.
225             </para>
226             <sect4 id="zend.service.flickr.classes.result.properties">
227                 <title>Свойства класса</title>
228                 <table>
229                     <title>Свойства класса Zend_Service_Flickr_Result</title>
230                     <tgroup cols="3">
231                         <thead>
232                             <row>
233                                 <entry>Имя</entry>
234                                 <entry>Тип</entry>
235                                 <entry>Описание</entry>
236                             </row>
237                         </thead>
238                         <tbody>
239                             <row>
240                                 <entry>id</entry>
241                                 <entry>string</entry>
242                                 <entry>ID изображения</entry>
243                             </row>
244                             <row>
245                                 <entry>owner</entry>
246                                 <entry>string</entry>
247                                 <entry>NSID владельца фотографии</entry>
248                             </row>
249                             <row>
250                                 <entry>secret</entry>
251                                 <entry>string</entry>
252                                 <entry>Ключ, используемый при построении URL</entry>
253                             </row>
254                             <row>
255                                 <entry>server</entry>
256                                 <entry>string</entry>
257                                 <entry>Имя сервера, используемое при построении URL</entry>
258                             </row>
259                             <row>
260                                 <entry>title</entry>
261                                 <entry>string</entry>
262                                 <entry>Подпись к фотографии</entry>
263                             </row>
264                             <row>
265                                 <entry>ispublic</entry>
266                                 <entry>string</entry>
267                                 <entry>Является ли фотография общедоступной</entry>
268                             </row>
269                             <row>
270                                 <entry>isfriend</entry>
271                                 <entry>string</entry>
272                                 <entry>Фотография доступна потому, что вы являетесь другом владельца.</entry>
273                             </row>
274                             <row>
275                                 <entry>isfamily</entry>
276                                 <entry>string</entry>
277                                 <entry>Фотография доступна потому, что вы являетесь членом семьи владельца.<!--The photo is visible to you because you are family of the owner.--></entry>
278                             </row>
279                             <row>
280                                 <entry>license</entry>
281                                 <entry>string</entry>
282                                 <entry>Лицензия, по которой доступна фотография</entry>
283                             </row>
284                             <row>
285                                 <entry>dateupload</entry>
286                                 <entry>string</entry>
287                                 <entry>Дата загрузки фотографии</entry>
288                             </row>
289                             <row>
290                                 <entry>datetaken</entry>
291                                 <entry>string</entry>
292                                 <entry>Дата получения фотографии</entry>
293                             </row>
294                             <row>
295                                 <entry>ownername</entry>
296                                 <entry>string</entry>
297                                 <entry>Ник пользователя</entry>
298                             </row>
299                             <row>
300                                 <entry>iconserver</entry>
301                                 <entry>string</entry>
302                                 <entry>Сервер, используемый в URL иконок</entry>
303                             </row>
304                             <row>
305                                 <entry>Square</entry>
306                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
307                                 <entry>Уменьшенная копия изображения 75x75</entry>
308                             </row>
309                             <row>
310                                 <entry>Thumbnail</entry>
311                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
312                                 <entry>Уменьшенная копия изображения 100x100</entry>
313                             </row>
314                             <row>
315                                 <entry>Small</entry>
316                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
317                                 <entry>Уменьшенная копия изображения 240x240</entry>
318                             </row>
319                             <row>
320                                 <entry>Medium</entry>
321                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
322                                 <entry>Уменьшенная копия изображения 500x500</entry>
323                             </row>
324                             <row>
325                                 <entry>Large</entry>
326                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
327                                 <entry>Уменьшенная копия изображения 640x640</entry>
328                             </row>
329                             <row>
330                                 <entry>Original</entry>
331                                 <entry><link linkend="zend.service.flickr.classes.image">Zend_Service_Flickr_Image</link></entry>
332                                 <entry>Оригинал изображения</entry>
333                             </row>
334                         </tbody>
335                     </tgroup>
336                 </table>
337                 <para>
338                     <link linkend="zend.service.flickr.classes">Назад к списку классов</link>
339                 </para>
340             </sect4>
341         </sect3>
342         <sect3 id="zend.service.flickr.classes.image">
343             <title>Zend_Service_Flickr_Image</title>
344             <para>
345                 Представляет изображение, возвращенное в результате поиска.
346             </para>
347             <sect4 id="zend.service.flickr.classes.image.properties">
348                 <title>Свойства класса</title>
349                 <table>
350                     <title>Свойства класса Zend_Service_Flickr_Image</title>
351                     <tgroup cols="3">
352                         <thead>
353                             <row>
354                                 <entry>Имя</entry>
355                                 <entry>Тип</entry>
356                                 <entry>Описание</entry>
357                             </row>
358                         </thead>
359                         <tbody>
360                             <row>
361                                 <entry>uri</entry>
362                                 <entry>string</entry>
363                                 <entry>URI для оригинального изображения</entry>
364                             </row>
365                             <row>
366                                 <entry>clickUri</entry>
367                                 <entry>string</entry>
368                                 <entry>Ссылка для изображения (страница Flickr)</entry>
369                             </row>
370                             <row>
371                                 <entry>width</entry>
372                                 <entry>int</entry>
373                                 <entry>Ширина изображения</entry>
374                             </row>
375                             <row>
376                                 <entry>height</entry>
377                                 <entry>int</entry>
378                                 <entry>Высота изображения</entry>
379                             </row>
380                         </tbody>
381                     </tgroup>
382                 </table>
383                 <para>
384                     <link linkend="zend.service.flickr.classes">Назад к списку классов</link>
385                 </para>
386             </sect4>
387         </sect3>
388     </sect2>
389 </sect1>
390 <!--
391 vim:se ts=4 sw=4 et: