From dae48d48839ba534bcd07cdbc49cb3bfa312b7d8 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Fri, 10 Feb 2023 16:34:19 +0000 Subject: [PATCH] Clean up Flickr demo --- .../geospatial/demo/config/flickr-album.tid | 2 -- .../geospatial/demo/config/flickr-param.tid | 2 ++ plugins/tiddlywiki/geospatial/demo/flickr.tid | 35 ++++++++++++++----- 3 files changed, 28 insertions(+), 11 deletions(-) delete mode 100644 plugins/tiddlywiki/geospatial/demo/config/flickr-album.tid create mode 100644 plugins/tiddlywiki/geospatial/demo/config/flickr-param.tid diff --git a/plugins/tiddlywiki/geospatial/demo/config/flickr-album.tid b/plugins/tiddlywiki/geospatial/demo/config/flickr-album.tid deleted file mode 100644 index 2f6c5dd42..000000000 --- a/plugins/tiddlywiki/geospatial/demo/config/flickr-album.tid +++ /dev/null @@ -1,2 +0,0 @@ -title: $:/config/flickr-album -text: 72157630297432522 diff --git a/plugins/tiddlywiki/geospatial/demo/config/flickr-param.tid b/plugins/tiddlywiki/geospatial/demo/config/flickr-param.tid new file mode 100644 index 000000000..1da892d3d --- /dev/null +++ b/plugins/tiddlywiki/geospatial/demo/config/flickr-param.tid @@ -0,0 +1,2 @@ +title: $:/config/flickr-param +text: 72157630297432522 diff --git a/plugins/tiddlywiki/geospatial/demo/flickr.tid b/plugins/tiddlywiki/geospatial/demo/flickr.tid index 412b64143..17d6a8319 100644 --- a/plugins/tiddlywiki/geospatial/demo/flickr.tid +++ b/plugins/tiddlywiki/geospatial/demo/flickr.tid @@ -5,7 +5,7 @@ tags: $:/tags/Macro $:/tags/GeospatialDemo -\procedure flickr-get-items(per_page:"100",page_number:"1",method:"flickr.photosets.getPhotos",resultPhotoRoot:"photoset") +\procedure flickr-get-items(per_page:"100",page_number:"1",method:"flickr.photosets.getPhotos",paramName:"group_id",resultPhotoRoot:"photoset") \procedure completion() \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] @@ -62,7 +62,8 @@ https://api.flickr.com/services/rest/ query-page=<> query-format="json" query-nojsoncallback="1" - query-photoset_id={{$:/config/flickr-album}} + $names="[addprefix[query-]]" + $values={{$:/config/flickr-param}} header-accept="application/json" password-query-api_key="flickr-api-key" bind-status="$:/temp/flickr/status" @@ -76,26 +77,42 @@ https://api.flickr.com/services/rest/ /> \end +\procedure flickr-get-photos-of-user-items() +<$macrocall $name="flickr-get-items" method="flickr.people.getPhotosOf" paramName="user_id" resultPhotoRoot="photos"/> +\end + +\procedure flickr-get-group-items() +<$macrocall $name="flickr-get-items" method="flickr.groups.pools.getPhotos" paramName="group_id" resultPhotoRoot="photos"/> +\end + \procedure flickr-get-album-items() -<$macrocall $name="flickr-get-items" method="flickr.photosets.getPhotos" resultPhotoRoot="photoset"/> +<$macrocall $name="flickr-get-items" method="flickr.photosets.getPhotos" paramName="photoset_id" resultPhotoRoot="photoset"/> \end \procedure flickr-get-interesting-items() <$macrocall $name="flickr-get-items" method="flickr.interestingness.getList" resultPhotoRoot="photos"/> \end -\procedure flickr-actions() -<$macrocall $name="flickr-get-album-items"/> -\end - ! Retrieve Geotagged Flickr Photos +Parameter for Flickr retrievals: <$edit-text tiddler="$:/config/flickr-param" tag="input"/> + <$button> <$macrocall $name="flickr-get-album-items"/> Get Flickr album - album ID: <$edit-text tiddler="$:/config/flickr-album" tag="input"/> + (parameter shuld be an album ID, e.g. 72157630297432522) <$button> <$macrocall $name="flickr-get-interesting-items"/> Get Flickr interesting items - + (no parameter needed) + +<$button> +<$macrocall $name="flickr-get-photos-of-user-items"/> +Get Flickr photos of user + (parameter shuld be a user ID, e.g. 35468148136@N01) + +<$button> +<$macrocall $name="flickr-get-group-items"/> +Get Flickr group + (parameter shuld be an album ID, e.g. 22075379@N00)