Created
May 9, 2016 20:04
-
-
Save JordiCorbilla/ebf1d9dd3e71bc0452c7fd4dca651db9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| procedure TfrmFlickr.RequestInformation_REST_Flickr(id: string); | |
| var | |
| Item, itemExisting: TListItem; | |
| response: string; | |
| iXMLRootNode, iXMLRootNode2, iXMLRootNode3, iXMLRootNode4: IXMLNode; | |
| views, title, likes, comments: string; | |
| stat: IStat; | |
| photo, existing: IPhoto; | |
| begin | |
| response := IdHTTP1.Get(TFlickrRest.new().getInfo(apikey.text, id)); | |
| XMLDocument1.LoadFromXML(response); | |
| iXMLRootNode := XMLDocument1.ChildNodes.first; | |
| iXMLRootNode2 := iXMLRootNode.NextSibling; | |
| iXMLRootNode3 := iXMLRootNode2.ChildNodes.first; | |
| views := iXMLRootNode3.attributes['views']; | |
| iXMLRootNode4 := iXMLRootNode3.ChildNodes.first; | |
| while iXMLRootNode4 <> nil do | |
| begin | |
| if iXMLRootNode4.NodeName = 'title' then | |
| title := iXMLRootNode4.NodeValue; | |
| if iXMLRootNode4.NodeName = 'comments' then | |
| comments := iXMLRootNode4.NodeValue; | |
| iXMLRootNode4 := iXMLRootNode4.NextSibling; | |
| end; | |
| response := IdHTTP1.Get(TFlickrRest.new().getFavorites(apikey.text, id)); | |
| XMLDocument1.LoadFromXML(response); | |
| iXMLRootNode := XMLDocument1.ChildNodes.first; | |
| iXMLRootNode2 := iXMLRootNode.NextSibling; | |
| iXMLRootNode3 := iXMLRootNode2.ChildNodes.first; | |
| likes := iXMLRootNode3.attributes['total']; | |
| end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment