232
229
if(flickcurl_prepare(fc, "flickr.contacts.getPublicList"))
235
flickcurl_set_write(fc, 1);
236
flickcurl_set_data(fc, (void*)"", 0);
238
doc = flickcurl_invoke(fc);
242
xpathCtx = xmlXPathNewContext(doc);
244
flickcurl_error(fc, "Failed to create XPath context for document");
249
contacts = flickcurl_build_contacts(fc, xpathCtx,
250
(xmlChar*)"/rsp/contacts/contact",
232
doc = flickcurl_invoke(fc);
236
xpathCtx = xmlXPathNewContext(doc);
238
flickcurl_error(fc, "Failed to create XPath context for document");
243
contacts = flickcurl_build_contacts(fc, xpathCtx,
244
(xmlChar*)"/rsp/contacts/contact",
250
xmlXPathFreeContext(xpathCtx);
260
* flickcurl_contacts_getTaggingSuggestions:
261
* @fc: flickcurl context
262
* @include_self: Return calling user in the list of suggestions. Default: true. (or NULL)
263
* @include_address_book: Include suggestions from the user's address book. Default: false (or NULL)
264
* @page: The page of results to return. If this argument is omitted, it defaults to 1. (or < 0)
265
* @per_page: Number of contacts to return per page. If this argument is omitted, all contacts will be returned. (or < 0)
267
* Get suggestions for tagging people in photos based on the calling user's contacts.
269
* Implements flickr.contacts.getTaggingSuggestions (1.25)
271
* NOTE: Parameter order is @page, @per_page like all other
272
* flickr.contacts.* calls, NOT @per_page, @page like in the API
275
* Return value: list of contacts or NULL on failure
278
flickcurl_contacts_getTaggingSuggestions(flickcurl* fc,
279
const char* include_self,
280
const char* include_address_book,
281
int page, int per_page)
283
xmlDocPtr doc = NULL;
284
xmlXPathContextPtr xpathCtx = NULL;
285
flickcurl_contact** contacts = NULL;
286
int contacts_count = 0;
288
char per_page_str[10];
290
flickcurl_init_params(fc, 0);
293
flickcurl_add_param(fc, "include_self", include_self);
294
if(include_address_book)
295
flickcurl_add_param(fc, "include_address_book", include_address_book);
297
sprintf(page_str, "%d", page);
298
flickcurl_add_param(fc, "page", page_str);
301
sprintf(per_page_str, "%d", per_page);
302
flickcurl_add_param(fc, "per_page", per_page_str);
305
flickcurl_end_params(fc);
307
if(flickcurl_prepare(fc, "flickr.contacts.getTaggingSuggestions"))
310
doc = flickcurl_invoke(fc);
314
xpathCtx = xmlXPathNewContext(doc);
316
flickcurl_error(fc, "Failed to create XPath context for document");
321
contacts = flickcurl_build_contacts(fc, xpathCtx,
322
(xmlChar*)"/rsp/contacts/contact",