File: README.html

package info (click to toggle)
flickcurl 1.26-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,508 kB
  • ctags: 3,340
  • sloc: ansic: 26,020; sh: 11,915; xml: 1,025; makefile: 343
file content (437 lines) | stat: -rw-r--r-- 23,832 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Flickcurl: C library for the Flickr API</title>
  <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>

<h1 style="text-align:center">Flickcurl: C library for the Flickr API</h1>
<h2 style="text-align:center"><a href="http://www.dajobe.org/">Dave Beckett</a></h2>


<p>Flickcurl is a C library for the
<a href="http://www.flickr.com/services/api/">Flickr API</a>,
handling creating the requests, signing, token management,
calling the API, marshalling request parameters and decoding responses.
It uses
<a href="http://curl.haxx.se/libcurl/">libcurl</a> to call the 
<a href="http://www.flickr.com/services/api/request.rest.html">REST web service</a>
and <a href="http://xmlsoft.org/">libxml2</a>
to manipulate the XML responses.
Flickcurl supports all of the API
(see <a href="coverage.html">Flickcurl API coverage</a> for details)
including the functions for photo/video uploading, browsing, searching,
adding and editing comments, groups, notes, photosets, categories,
activity, blogs, favorites, places, tags, machine tags, institutions,
pandas and photo/video metadata.  It also includes a program
<code>flickrdf</code> to turn photo metadata, tags, machine tags and
places into an RDF triples description.
</p>

<p>License: LGPL 2.1+ / GPL 2+  / Apache 2.0+</p>

<p>Download: <a href="http://download.dajobe.org/flickcurl/">http://download.dajobe.org/flickcurl/</a>
</p>

<p>Docs: <a href="http://librdf.org/flickcurl/api/">Flickcurl API reference manual</a></p>

<p>News: <a href="NEWS.html">Flickcurl News</a> including changes</p>

<p>Requirements: the following libraries are needed:</p>
<ul>
  <li><a href="http://curl.haxx.se/libcurl/">libcurl</a> 7.10.0 or newer</li>
  <li><a href="http://xmlsoft.org/">libxml2</a> 2.6.8 or newer</li>
  <li><a href="http://librdf.org/raptor/">raptor</a> 2.0.0 (optional)</li>
</ul>

<p>Then do the usual <code>./configure</code>, <code>make</code> and
<code>make install</code> sequence to install the library and
the flickcurl and flickrdf utilities.</p>

<p><a href="http://github.com/">GitHub</a> hosts the sources for
Flickcurl at the
<a href="https://github.com/dajobe/flickcurl">GitHub flickcurl project page</a>.
</p>

<p>Checkout with:</p>
<pre>
  git clone git://github.com/dajobe/flickcurl.git

  # Get the libmtwist submodule and fetch its content with:

  git submodule update --init
</pre>


<h2>Flickr API Configuration</h2>

<p>The library needs to know your Flickr API OAuth token, token
secret, client key and client secret, suitable for calling some of
the API calls.  To obtain these, you need to
<a href="http://www.flickr.com/services/api/keys/apply/">apply for API keys</a>
at the Flickr Services site.  When using the utility programs, this
information should be stored in the <code>~/.flickcurl.conf</code> file
so that it can be read at run-time.  The configuration file has the
format:</p>
<pre>
[flickr]
oauth_token=12345678901234567-abcdef0123456789
oauth_token_secret=abcdef9876543210
oauth_client_key=0123456789abcdef0123456789abcdef
oauth_client_secret=fedcba9876543210
</pre>

<p>See
<a href="http://librdf.org/flickcurl/api/flickcurl-auth.html">Authenticating Flickcurl for OAuth</a>
in the manual for full details of how to build flickcurl,
authenticate and set up the configuration file above.
</p>


<h2>Utility programs</h2>

<h3><code>flickcurl</code> - call Flickr API</h3>

<p>This can call some of the Flickr APIs plus help with
OAuth authentication steps to get the final set of tokens and secrets
and writing them into <code>~/.flickcurl.conf</code> file.  Use
<code>flickcurl -h</code> to get a list of the supported commands and
their arguments.
</p>

<p>This example calls the 
<a href="http://www.flickr.com/services/api/flickr.photos.getInfo.html">photos.getInfo</a>
API via the <code>photos-getInfo</code> command on photo 196308964 which
decodes the returned XML into fields in a <code>flickcurl_photo</code> structure
which are then printed with their datatype, string value and integer
value (or -1 if it has none).  All dateTime values are converted into
both the ISO format string (such as used by Web and XML standards) and
unix time integers.  Photo tags are also returned when present along
with their id, author, raw, cooked and machine tag status.
</p>

<pre>
$ flickcurl photos.getInfo 196308964
flickcurl: photo with URI http://www.flickr.com/photos/dajobe/196308964/ ID 196308964 and 5 tags
    field dateuploaded (1) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
    field farm (2) with integer value: '1' / 1
    field isfavorite (3) with boolean value: '0' / 0
    field license (4) with integer value: '1' / 1
    field originalformat (5) with string value: 'jpg' / -1
    field rotation (6) with integer value: '0' / 0
    field server (7) with integer value: '57' / 57
    field dates_lastupdate (8) with dateTime value: '2007-02-25T07:45:46Z' / 1172389546
    field dates_posted (9) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
    field dates_taken (10) with string value: '2006-07-22 22:28:50' / -1
    field dates_takengranularity (11) with integer value: '0' / 0
    field editability_canaddmeta (13) with boolean value: '1' / 1
    field editability_cancomment (14) with boolean value: '1' / 1
    field geoperms_iscontact (15) with boolean value: '0' / 0
    field geoperms_isfamily (16) with boolean value: '0' / 0
    field geoperms_isfriend (17) with boolean value: '0' / 0
    field geoperms_ispublic (18) with boolean value: '1' / 1
    field location_accuracy (19) with integer value: '12' / 12
    field location_latitude (20) with float value: '36.620487' / -1
    field location_longitude (21) with float value: '-121.904468' / -1
    field owner_location (22) with string value: 'Mountain View, California, USA' / -1
    field owner_nsid (23) with string value: '13355580@N00' / -1
    field owner_realname (24) with string value: 'Dave Beckett' / -1
    field owner_username (25) with string value: 'dajobe' / -1
    field title (26) with string value: 'Jellyfish at Monterey Aquarium' / -1
    field visibility_isfamily (27) with boolean value: '0' / 0
    field visibility_isfriend (28) with boolean value: '0' / 0
    field visibility_ispublic (29) with boolean value: '1' / 1
    field secret (30) with string value: 'b34cb0af68' / -1
    field originalsecret (31) with string value: 'b34cb0af68' / -1
    field location_locality (33) with string value: 'Pacific Grove' / -1
    field location_region (35) with string value: 'California' / -1
    field location_country (36) with string value: 'United States' / -1
    field location_placeid (37) with string value: 'J1HdelRTVrx7R.g2' / -1
    field locality_placeid (39) with string value: 'J1HdelRTVrx7R.g2' / -1
    field county_placeid (40) with string value: 'fpIAzjpQUL9F5MEpDw' / -1
    field region_placeid (41) with string value: 'NsbUWfBTUb4mbyVu' / -1
    field country_placeid (42) with string value: 'nz.gsghTUb4c2WAecA' / -1
    field location_woeid (43) with string value: '2467327' / -1
    field locality_woeid (45) with string value: '2467327' / -1
    field county_woeid (46) with string value: '12587696' / -1
    field region_woeid (47) with string value: '2347563' / -1
    field country_woeid (48) with string value: '23424977' / -1
    field usage_candownload (49) with boolean value: '1' / 1
    field usage_canblog (50) with boolean value: '1' / 1
    field usage_canprint (51) with boolean value: '1' / 1
    field views (56) with integer value: '529' / 529
tags:
0) regular tag: id 94493-196308964-3362 author ID 13355580@N00 name (Unknown) raw 'jellyfish' cooked 'jellyfish' count 0
1) regular tag: id 94493-196308964-119180 author ID 13355580@N00 name (Unknown) raw 'montereyaquarium' cooked 'montereyaquarium' count 0
2) regular tag: id 94493-196308964-2443 author ID 13355580@N00 name (Unknown) raw 'monterey' cooked 'monterey' count 0
3) machine tag: id 94493-196308964-8499312 author ID 13355580@N00 name (Unknown) raw 'xmlns:dc=http://purl.org/dc/elements/1.1/' cooked 'xmlns:dc=httppurlorgdcelements11' count 0
4) machine tag: id 94493-196308964-8499315 author ID 13355580@N00 name (Unknown) raw 'dc:subject=jellyfish' cooked 'dc:subject=jellyfish' count 0
notes:
  Location: latitude 36.620487  longitude -121.904468  accuracy unknown
  0) place location: name '
		' id J1HdelRTVrx7R.g2 woeid 2467327
  2) place locality: name 'Pacific Grove' id J1HdelRTVrx7R.g2 woeid 2467327
  3) place county: name 'Monterey' id fpIAzjpQUL9F5MEpDw woeid 12587696
  4) place region: name 'California' id NsbUWfBTUb4mbyVu woeid 2347563
  5) place country: name 'United States' id nz.gsghTUb4c2WAecA woeid 23424977
</pre>



<h3><code>flickrdf</code> - generate RDF triples from a Flickr photo</h3>

<p>This utility uses the photos.getInfo API to interpret the
description fields, tags and places for a photo URI into RDF triples.
If <a href="http://librdf.org/raptor/">raptor</a> is present,
it will be used to provide proper serializing to RDF rather than
the built in and hacky ntriples/turtle output.
</p>

<p>Machine tags when they are found are scanned
for <code>xmlns:<em>prefix</em>=<em>uri</em></code> and then all
other machine tags with that <em>prefix</em> turn into triples.
Several prefixes are also pre-defined by the library to automatically
get turned into triples without an <code>xmlns</code>, such
as <code>blue:</code>, <code>cell:</code>,
<code>filter:</code> and <code>geo:</code>.  Non-machine tags
are not yet interpreted.
</p>

<p>Places attached to photos are turned into extra information
blocks (sets of triples) hung off a <code>places:place</code>
predicate.</p>

<pre>
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/creator&gt; _:person .
_:person &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Person&gt; .
_:person &lt;http://xmlns.com/foaf/0.1/#maker&gt; &lt;http://www.flickr.com/photos/dajobe/196308964/&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/dateSubmitted&gt; "2006-07-23T18:16:13Z"^^&lt;http://www.w3.org/2001/XMLSchema#dateTime&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/rights&gt; &lt;http://creativecommons.org/licenses/by-nc-sa/2.0/&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/modified&gt; "2007-02-25T07:45:46Z"^^&lt;http://www.w3.org/2001/XMLSchema#dateTime&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/issued&gt; "2006-07-23T18:16:13Z"^^&lt;http://www.w3.org/2001/XMLSchema#dateTime&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/created&gt; "2006-07-22T22:28:50Z"^^&lt;http://www.w3.org/2001/XMLSchema#dateTime&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://www.w3.org/2003/01/geo/wgs84_pos#lat&gt; "36.620487"^^&lt;http://www.w3.org/2001/XMLSchema#double&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://www.w3.org/2003/01/geo/wgs84_pos#long&gt; "-121.904468"^^&lt;http://www.w3.org/2001/XMLSchema#double&gt; .
_:person &lt;http://xmlns.com/foaf/0.1/#name&gt; "Dave Beckett" .
_:person &lt;http://xmlns.com/foaf/0.1/#nick&gt; "dajobe" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/terms/title&gt; "Jellyfish at Monterey Aquarium" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://purl.org/dc/elements/1.1/subject&gt; "jellyfish" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Places#place&gt; _:place0 .
_:place0 &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://machinetags.org/ns/Places#Place&gt; .
_:place0 &lt;http://machinetags.org/ns/Places#type&gt; "location" .
_:place0 &lt;http://machinetags.org/ns/Places#id&gt; "WM3JEXSbBZqqRtGA" .
_:place0 &lt;http://machinetags.org/ns/Places#placeid&gt; "2467327" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Places#place&gt; _:place2 .
_:place2 &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://machinetags.org/ns/Places#Place&gt; .
_:place2 &lt;http://machinetags.org/ns/Places#type&gt; "locality" .
_:place2 &lt;http://machinetags.org/ns/Places#name&gt; "Pacific Grove" .
_:place2 &lt;http://machinetags.org/ns/Places#id&gt; "WM3JEXSbBZqqRtGA" .
_:place2 &lt;http://machinetags.org/ns/Places#placeid&gt; "2467327" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Places#place&gt; _:place3 .
_:place3 &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://machinetags.org/ns/Places#Place&gt; .
_:place3 &lt;http://machinetags.org/ns/Places#type&gt; "county" .
_:place3 &lt;http://machinetags.org/ns/Places#name&gt; "Monterey" .
_:place3 &lt;http://machinetags.org/ns/Places#id&gt; "AQ4UpRqYA5l0BiyF.A" .
_:place3 &lt;http://machinetags.org/ns/Places#placeid&gt; "12587696" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Places#place&gt; _:place4 .
_:place4 &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://machinetags.org/ns/Places#Place&gt; .
_:place4 &lt;http://machinetags.org/ns/Places#type&gt; "region" .
_:place4 &lt;http://machinetags.org/ns/Places#name&gt; "California" .
_:place4 &lt;http://machinetags.org/ns/Places#id&gt; "SVrAMtCbAphCLAtP" .
_:place4 &lt;http://machinetags.org/ns/Places#placeid&gt; "2347563" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Places#place&gt; _:place5 .
_:place5 &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://machinetags.org/ns/Places#Place&gt; .
_:place5 &lt;http://machinetags.org/ns/Places#type&gt; "country" .
_:place5 &lt;http://machinetags.org/ns/Places#name&gt; "United States" .
_:place5 &lt;http://machinetags.org/ns/Places#id&gt; "4KO02SibApitvSBieQ" .
_:place5 &lt;http://machinetags.org/ns/Places#placeid&gt; "23424977" .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Flickr#photo&gt; &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Image&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt; &lt;http://www.w3.org/2000/01/rdf-schema#label&gt; "Square" .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt; &lt;http://machinetags.org/ns/Flickr#width&gt; "75"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt; &lt;http://machinetags.org/ns/Flickr#height&gt; "75"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Flickr#photo&gt; &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Image&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; &lt;http://www.w3.org/2000/01/rdf-schema#label&gt; "Thumbnail" .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; &lt;http://machinetags.org/ns/Flickr#width&gt; "75"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; &lt;http://machinetags.org/ns/Flickr#height&gt; "100"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Flickr#photo&gt; &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Image&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt; &lt;http://www.w3.org/2000/01/rdf-schema#label&gt; "Small" .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt; &lt;http://machinetags.org/ns/Flickr#width&gt; "180"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt; &lt;http://machinetags.org/ns/Flickr#height&gt; "240"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Flickr#photo&gt; &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Image&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt; &lt;http://www.w3.org/2000/01/rdf-schema#label&gt; "Medium" .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt; &lt;http://machinetags.org/ns/Flickr#width&gt; "375"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt; &lt;http://machinetags.org/ns/Flickr#height&gt; "500"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://www.flickr.com/photos/dajobe/196308964/&gt; &lt;http://machinetags.org/ns/Flickr#photo&gt; &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/#Image&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt; &lt;http://www.w3.org/2000/01/rdf-schema#label&gt; "Original" .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt; &lt;http://machinetags.org/ns/Flickr#width&gt; "600"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt; &lt;http://machinetags.org/ns/Flickr#height&gt; "800"^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; .
</pre>

<p>If you have raptor installed, you can get nicer RDF triples out
and with <code>rapper</code> 1.4.14+, pretty-printed turtle:</p>
<pre>
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
@prefix dc: &lt;http://purl.org/dc/elements/1.1/&gt; .
@prefix foaf: &lt;http://xmlns.com/foaf/0.1/#&gt; .
@prefix geo: &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt; .
@prefix dcterms: &lt;http://purl.org/dc/terms/&gt; .
@prefix places: &lt;http://machinetags.org/ns/Places#&gt; .
@prefix flickr: &lt;http://machinetags.org/ns/Flickr#&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;http://www.flickr.com/photos/dajobe/196308964/&gt;
    flickr:photo &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt;, &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt;, &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt;, &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt;, &lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt; ;
    places:place [
        places:id "WM3JEXSbBZqqRtGA" ;
        places:placeid "2467327" ;
        places:type "location" ;
        a places:Place
    ], [
        places:id "WM3JEXSbBZqqRtGA" ;
        places:name "Pacific Grove" ;
        places:placeid "2467327" ;
        places:type "locality" ;
        a places:Place
    ], [
        places:id "AQ4UpRqYA5l0BiyF.A" ;
        places:name "Monterey" ;
        places:placeid "12587696" ;
        places:type "county" ;
        a places:Place
    ], [
        places:id "SVrAMtCbAphCLAtP" ;
        places:name "California" ;
        places:placeid "2347563" ;
        places:type "region" ;
        a places:Place
    ], [
        places:id "4KO02SibApitvSBieQ" ;
        places:name "United States" ;
        places:placeid "23424977" ;
        places:type "country" ;
        a places:Place
    ] ;
    dc:subject "jellyfish" ;
    dcterms:created "2006-07-22T22:28:50Z"^^xsd:dateTime ;
    dcterms:creator [
        a foaf:Person ;
        foaf:maker &lt;http://www.flickr.com/photos/dajobe/196308964/&gt; ;
        foaf:name "Dave Beckett" ;
        foaf:nick "dajobe"
    ] ;
    dcterms:dateSubmitted "2006-07-23T18:16:13Z"^^xsd:dateTime ;
    dcterms:issued "2006-07-23T18:16:13Z"^^xsd:dateTime ;
    dcterms:modified "2007-02-25T07:45:46Z"^^xsd:dateTime ;
    dcterms:rights &lt;http://creativecommons.org/licenses/by-nc-sa/2.0/&gt; ;
    dcterms:title "Jellyfish at Monterey Aquarium" ;
    geo:lat 36.620487 ;
    geo:long -121.904468 .

&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_s.jpg&gt;
    flickr:height 75 ;
    flickr:width 75 ;
    a foaf:Image ;
    rdfs:label "Square" .

&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_t.jpg&gt;
    flickr:height 100 ;
    flickr:width 75 ;
    a foaf:Image ;
    rdfs:label "Thumbnail" .

&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_m.jpg&gt;
    flickr:height 240 ;
    flickr:width 180 ;
    a foaf:Image ;
    rdfs:label "Small" .

&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68.jpg&gt;
    flickr:height 500 ;
    flickr:width 375 ;
    a foaf:Image ;
    rdfs:label "Medium" .

&lt;http://farm1.static.flickr.com/57/196308964_b34cb0af68_o.jpg&gt;
    flickr:height 800 ;
    flickr:width 600 ;
    a foaf:Image ;
    rdfs:label "Original" .
</pre>


<h2>Library use example</h2>

<p>See <code>examples/print-photo-info.c</code></p>
<pre>
#include &lt;stdio.h&gt;
#include &lt;flickcurl.h&gt;

int main(int argc, char *argv[]);

int main(int argc, char *argv[]) {
  flickcurl *fc;
  flickcurl_photo *photo;
  flickcurl_photo_field_type field_type;
  int i;

  flickcurl_init(); /* optional static initialising of resources */
  fc = flickcurl_new();

  /* Set configuration, or more likely read from a config file */
  flickcurl_set_oauth_client_key(fc, "...");
  flickcurl_set_oauth_client_secret(fc, "...");
  flickcurl_set_oauth_token(fc, "...");
  flickcurl_set_oauth_token_secret(fc, "...");

  photo = flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */

  for(field_type = 0; field_type &lt;= PHOTO_FIELD_LAST; field_type++) {
    flickcurl_field_value_type datatype = photo-&gt;fields[field_type].type;
    
    if(datatype != VALUE_TYPE_NONE)
      fprintf(stderr, "field %s (%d) with %s value: '%s' / %d\n", 
              flickcurl_get_photo_field_label(field_type), (int)field_type,
              flickcurl_get_field_value_type_label(datatype),
              photo-&gt;fields[field_type].string,
              photo-&gt;fields[field_type].integer);
  }

  for(i = 0; i &lt; photo-&gt;tags_count; i++) {
    flickcurl_tag* tag=photo-&gt;tags[i];
    fprintf(stderr,
            "%d) %s tag: id %s author ID %s name %s raw '%s' cooked '%s' count %d\n",
            i, (tag-&gt;machine_tag ? "machine" : "regular"),
            tag-&gt;id, tag-&gt;author, 
            (tag-&gt;authorname ? tag-&gt;authorname : "(Unknown)"), 
            tag-&gt;raw, tag-&gt;cooked,
            tag-&gt;count);
  }

  flickcurl_free_photo(photo);
  flickcurl_free(fc);
  flickcurl_finish(); /* optional static free of resources */

  return 0;
}
</pre>

<p>For more extensive example code, see the source of the
<code>flickcurl</code> utility in <code>flickcurl.c</code>
which has code that calls all the API functions.
</p>


<hr />

<p>Copyright (C) 2007-2014 <a href="http://www.dajobe.org/">Dave Beckett</a></p>

</body>
</html>