Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JordiCorbilla/ebf1d9dd3e71bc0452c7fd4dca651db9 to your computer and use it in GitHub Desktop.
Save JordiCorbilla/ebf1d9dd3e71bc0452c7fd4dca651db9 to your computer and use it in GitHub Desktop.
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