diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Example Flickr.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Example Flickr.tid new file mode 100644 index 000000000..d2ce6b0bb --- /dev/null +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Example Flickr.tid @@ -0,0 +1,81 @@ +title: WidgetMessage: tm-http-request Example - Flickr +tags: $:/tags/Macro + +\define flickr-get-album-items() + +\define completion() +\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] + <$action-log msg="In completion"/> + <$action-log/> + + <$list filter="[compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore"> + <$list filter="[jsonindexes[photoset],[photo]]" variable="photoIndex"> + <$let + photoData={{{ [jsonextract[photoset],[photo],] }}} + photoFarm={{{ [jsonget[farm]] }}} + photoServer={{{ [jsonget[server]] }}} + photoID={{{ [jsonget[id]] }}} + photoSecret={{{ [jsonget[secret]] }}} + > + <$action-setfield + $tiddler={{{ [addprefix[Flickr Photo ]] }}} + tags="$:/tags/GeoMarker $:/tags/FlickrPhoto" + caption={{{ [jsonget[title]] }}} + lat={{{ [jsonget[latitude]] }}} + long={{{ [jsonget[longitude]] }}} + alt="0" + photo-url={{{ [[https://farm]addsuffixaddsuffix[.staticflickr.com/]addsuffixaddsuffix[/]addsuffixaddsuffix[_]addsuffixaddsuffix[_b.jpg]] }}} + icon-url={{{ [[https://farm]addsuffixaddsuffix[.staticflickr.com/]addsuffixaddsuffix[/]addsuffixaddsuffix[_]addsuffixaddsuffix[_s.jpg]] }}} + /> + + + +\end completion + +\define progress() +\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] + <$action-log message="In progress-actions"/> +\end progress + +\define request-url() +https://api.flickr.com/services/rest/ +\end request-url + +<$action-sendmessage + $message="tm-http-request" + url=<> + method="GET" + query-method="flickr.photosets.getPhotos" + query-extras="geo" + query-format="json" + query-nojsoncallback="1" + query-photoset_id={{$:/config/flickr-album}} + header-accept="application/json" + password-query-api_key="flickr-api-key" + bind-status="$:/temp/flickr/status" + bind-progress="$:/temp/flickr/progress" + oncompletion=<> + onprogress=<> + var-start=<<__start__>> + var-limit=<<__limit__>> +/> +\end + +\define flickr-actions() +<$macrocall $name="flickr-get-album-items"/> +\end + +! Map of Flickr Photos + +Flickr API Key: <$password name="flickr-api-key"/> + +Flickr album ID: <$edit-text tiddler="$:/config/flickr-album" tag="input"/> + +<$button actions=<>> +Call Flickr + + +<$geomap + markers="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]tag[$:/tags/FlickrPhoto]]" + +/> diff --git a/editions/tw5.com/tiddlers/messages/config-flickr-album.tid b/editions/tw5.com/tiddlers/messages/config-flickr-album.tid new file mode 100644 index 000000000..2f6c5dd42 --- /dev/null +++ b/editions/tw5.com/tiddlers/messages/config-flickr-album.tid @@ -0,0 +1,2 @@ +title: $:/config/flickr-album +text: 72157630297432522 diff --git a/plugins/tiddlywiki/geospatial/demo/ui/geomarker.tid b/plugins/tiddlywiki/geospatial/demo/ui/geomarker.tid index d2333d436..84c530cf1 100644 --- a/plugins/tiddlywiki/geospatial/demo/ui/geomarker.tid +++ b/plugins/tiddlywiki/geospatial/demo/ui/geomarker.tid @@ -100,3 +100,11 @@ Maximum time: <$edit-text tiddler="$:/config/plugins/geospatial/traveltime/time" |Status Code |<$text text={{$:/temp/_StatusCode}}/> | |Status Text |<$text text={{$:/temp/_StatusText}}/> | |Error |<$text text={{$:/temp/_Error}}/> | + +<$list filter="[has[photo-url]]" variable="ignore"> + +!! Photo + + + + \ No newline at end of file