|
Pipe: Flickr user photostream
 |
The RSS feed output by this Pipe is now geo-enabled. If any of the photos in your photostream has geo data, the Yahoo! Pipes interface will offer an option “More Options > Get as KML”, which you may then view in Google Earth.
Posted 4 months ago.
(
permalink
)
|
 |
Brilliant! Just what I was hoping could be done (very nearly!), in Google Earth.
How difficult would it be to add a "Description" link to the item, below the thumbnail (rather than having to follow "More Info"?
Also, I wonder whether it would be possible to "sort by date taken"?
Or should I learn Pipes? I'm new to Flickr but have been geo-tagging and using GE for a couple of years now.
Originally posted 4 months ago.
(
permalink
)
Ian Chappel edited this topic 4 months ago.
|
 |
Ian Chappel, yes, it’s a great idea to learn how to build Pipes. Once you get the hang of them, it is simple to build powerful applications in a short time.
it’s possible to include the description. However, the response of the Flickr method flickr.people.getPublicPhotos does not include the description. To get the description, you would have to call flickr.photos.getInfo for every photo in the list. That is perfectly doable, but I left it out to keep the Pipe efficient (otherwise, for a list of 100 photos, the Pipe would have to call flickr 100 times, and that would slow it down).
Yes, it is possible to sort by date-taken. In the documentation of flickr.photos.getInfo, you will see that by passing “date_taken” inside the “extras” parameter, the response will then include the date the photo was taken on, in the format “2008-01-04 17:02:39”. Then in the Pipe, you would have to first convert that from text to a value that is understood by Pipes to be a date, and then you can sort on it. If you’re interested in doing it, start experimenting, and I can help you go through it where you get stuck, if you do.
Posted 4 months ago.
(
permalink
)
|
 |
Thanks Alto, I've been playing around and been successful apart from getting the Description.
Is it possible to create a link to the Description, rather than actually including the text in the output? So that if someone had the KML and I changed the Description, they'd see the up-to-date text (same as if I edited the photo), without me re-running the Pipe.
BTW I didn't need flickr.photos.getInfo to to obtain Date_Taken - maybe that's a typo? And also, the sort on Date_Taken works fine on the text.
Posted 4 months ago.
(
permalink
)
|
 |
Ian Chappel, I’ll answer your question completely another time…
However, a quick note… the KML document is re-generated by Pipes (i.e. the Pipe is re-run) every time it is accessed. If you view it in Google Maps, it will always be “fresh” e.g. your feed in Google Maps. To view it “live” in Google Earth, rather than clicking on the KML link, copy the KML link and in Google Earth select “Add > Network Link” and paste the KML link into the “link” box.
Originally posted 4 months ago.
(
permalink
)
alto maltés edited this topic 4 months ago.
|
 |
Alto, I'm probably posting under the wrong topic, as what I'm working with is a Set rather than a Photostream - but I did originally start with this Pipe.
I've tried Live and Static, and can see the pros and cons of both. I'd like to generate a static KML, so's I can include other info such as non-photo Notes and Polylines (tracklogs) and "Snapshot View". I'd also like to keep the KML/KMZ as small as possible so's I can view it in maps.google.com, which seems to have a limit ~1Mb at present. And keep info related to a photo up-to-date.
I've got it how I want, except would just like to "link in" the description, so's it appears in the KML/KMZ, but is linked to Flickr's description, so it is viewed without clicking a "More Info" or similar hyperlink.
Is this possible? If so, a few clues would be much appreciated - I'm spending way too much time playing with Pipes when I should be working!
Posted 4 months ago.
(
permalink
)
|
 |
Ian Chappel, no problem.
About keeping the KML as small as possible, you really don’t have to worry! You would really have to include a lot of items to drive a KML document (a text document) to 1MB! Don’t forget that photos are not included inside KML (and RSS and HTML) files, they only link to them.
Yes, it is possible. All you have to do is loop through the items and call flickr.photos.getInfo for each one, and then append the photo description to the item description. There you go. I added it to the end of the pipe just before the “Sub-element” module so it is clear and to be quick.
Posted 4 months ago.
(
permalink
)
|
 |
Thanks, that's great! Quicker than I'd feared as well.
Do I assume then that it wouldn't be possible to retrieve the Description live, without following a link? It's not so much a question of filesize, but duplication of data (is it called data-redundancy?). If I edited the photo in Flickr I'd see the new one when viewing the KML, but if I edited the description I wouldn't.
Also a slight shame that flickr.photos.getInfo doesn't appear to preserve line or paragraph breaks.
Don't get me wrong, I'm fascinated/amazed by what [you] can do with Pipes, which I've only just discovered, but we always want more and strive for perfection!!
Posted 4 months ago.
(
permalink
)
|
 |
Ian Chappel, the description should update, but give it some time. Don’t forget that there are 3 systems in between your Flickr photo and what you see in Google Maps. Ok, the Flickr API probably reflects the changes immediately, but both Pipes and Maps probably implement some form of caching i.e. they keep remembering results for some span of time so that they don’t have to ask for it every time.
Thanks for pointing the line-breaks issue out. I checked it out, and it is actually a Pipes issue not of the Flickr API. Actually flickr.photos.getInfo does preserve line-breaks, but as newline characters, not as HTML <br/> tags. You can verify this by seeing the source of the response XML in a browser. It will start new lines at the correct places.
In theory, we should be able to rectify this by replacing all occurrences of the regular expression “[\n\r]” with “<br/>”. However in practice it does not work, as it seems that when Pipes detects tags in a field, it parses its content as HTML, and since in HTML newlines are equivalent to whitespace, it discards the newlines and replaces them with spaces.
I don't get you wrong. Rather, I appreciate your feedback very much!, and I share your goal.
Posted 4 months ago.
(
permalink
)
|
 |
Alto, I think we have our wires (or pipes?) slightly crossed!
What I was hoping to do was have the text in a Static KML linked to Flickr. If you look inside this KML (I've had to ZIP it because my ISP won't serve KML/KMZ, something to do with MIME types), you'll see that the text is just that (i.e. not "live"), i.e. if I update the text in Flickr, I'd need to re-run the Pipe to see the updated text. But if I edited the photo, I'd see the updated one, without using any Pipes.
Also, in Flickr, there is a line-break after the first sentence, but this doesn't show up in the API explorer. The description including line-breaks was created in the photo's IPTC (no editing within Flickr, just a straight upload).
Originally posted 4 months ago.
(
permalink
)
Ian Chappel edited this topic 4 months ago.
|
 |
Ian Chappel, hehe :)
Inside a KML file, you can’t “link” text in the same way you link images (I’m lying, the technology exists, but it is virtually not implemented by anyone, so forget it for the following few years at least…). But you don’t need to “link” the text in the way you want to do it. The URL of the KML document you get from Pipes (by right-clicking “Get as KML” and copying the link) is a “live” URL, in that every time you request that URL, the Pipe is re-run i.e. the whole chain of processes is invoked i.e. the Flickr API is called.
Now, what happens is that when you click on “Get as KML”, you instruct the browser to open the KML file. Browsers do not normally handle KML files, so they download the file to some temporary location on your hard disk, and invoke the external (to the browser) application on your computer that knows how to handle KML files i.e. Google Earth (GE). This opens the file from disk, and you see the result. However, if you open it in this way, GE doesn’t know the source pipes.yahoo.com URL of the file. If you choose to “add to your places”, it will just save that file in a more permanent location… but your descriptions will never be updated. For images it’s a different story since KML files do not contain the image content i.e. pixels, but link to them via their URL.
However you can still view the KML document “live” (with descriptions up to date) both in GE as well as in Google Maps (GM). In GE, add the KML URL as what it calls a “network link”, as I explained before.
In GM you can paste your link into the query box and submit. Once loaded, you can click on “Link to this page”, and the URL you will get will be a “live” link i.e. every time you access that page, GM will call Pipes, which will call Flickr, which will respond with the updated descriptions. Except when one of the intermediate systems happens to answer a request with something from the cache, of course.
And yes, the line-breaks are preserved by the API. Open the page you told me. The browser is formatting the XML file, so you won’t realize from here. “View source” in your browser, and you will see it.
Posted 4 months ago.
(
permalink
)
|
 |
OK Alto. I did understand about Network Links etc., I just wasn't sure how well I'd explained what I was trying to do - which was as you describe in your first sentence (achieving the impossible!). I had imagined linking as you might link cells in Excel (or an image in HTML), i.e. seeing the result of a link as opposed to a hyperlink. I'm really quite surprised that's not possible actually! But at least I can abandon my quest for now.....
And I do see that the browser's formatting the XML, something which to me was not at all obvious.
Thanks again, Ian
PS I hadn't realised though that I could just create a link for both GE and Google Maps without actually needing to upload anything. That's pretty neat, especially as my regular ISP won't host KML/KMZ. I had been creating a Network Link in GE, pasting in the link produced by Pipes, and then saving/uploading a very small KML.
Originally posted 4 months ago.
(
permalink
)
Ian Chappel edited this topic 4 months ago.
|
 |
Ian Chappel, ok.
It will be possible when XInclude starts being supported by systems, if it will someday.
You are welcome. Yes, it’s quite neat. Yes, for Google Maps you can create a simple link. For Google Earth no… until Pipes team offer KML network link as a output format, which would be quite trivial to implement.
It is also quite trivial to write a short PHP script that will take a URL as a parameter, and return a KML network-link document pointing to that document… it probably already exists.
Originally posted 4 months ago.
(
permalink
)
alto maltés edited this topic 4 months ago.
|
 |
Ian Chappel, I suggested it to the Pipes team…
Posted 4 months ago.
(
permalink
)
|
 |
Good idea Alto!
One other thing I'd like to change/improve, and I'm not sure if it's possible or hard-wired by the Pipes team - the KML output includes a Timestamp for each item - currently this is date_upload, whereas in the case at least of a Set, the date_taken would generally be more relevant.
Posted 4 months ago.
(
permalink
)
|
 |
Ian Chappel, no, that’s not hard-wird by Pipes team! I set it like that. Just change it. Make sure the “date_taken” is being passed as a parameter to “extras”, so that the Flickr API will include it in the response. The date taken will be in the form “YYYY:MM:DD HH:MM:SS”, or something like that. Embed a “Date Builder” in a “Loop”, pass it the date taken in this format, and Pipes will recognize it and construct a date object correctly from it, and assign the result to “y:published”. Done.
Posted 4 months ago.
(
permalink
)
|
 |
Ian Chappel, I read your post (is it?)… to make the Pipe generate an iCal instead of KML just change _render=kml to _render=ical in the Pipes URL!
Posted 4 months ago.
(
permalink
)
|
 |
Alto, no that wasn't me actually - but it does look interesting!
Posted 4 months ago.
(
permalink
)
|
 |
Alto, I know you said earlier above that it wasn't possible to preserve line breaks (from a Flickr description) into a KML description, for reasons that I sort of understand.
Assuming that Pipes is continually developing, is this still the case? Or does in warrant a suggestion to the Pipes team? Or is there a workaround?
Originally posted 2 months ago.
(
permalink
)
Ian Chappel edited this topic 2 months ago.
|
 |
Hi,
this is the best tool for my WiFi photoframe from samsung. BUT Ihave a small request..
now it refers to the full image size but is it possible to give an extra option field with sizes?
my screen is 800x600 pixels and uses max 64 mb for the rss, so when the big images from the rss are 800x600, I would have alot more pictures!!
love your work
Yves
Originally posted 6 weeks ago.
(
permalink
)
Fam. Snoeren edited this topic 6 weeks ago.
|
 |
I just looked in to it.. can you give us the option like this? (I could use the "large" image =300kb vs the original = 800 kb and more)
Square
(75 x 75)
Thumbnail
(100 x 67)
Small
(240 x 160)
Medium
(500 x 333)
Large
(1024 x 681)
Original
(3008 x 2000)
and think this option would very usefull for many guys (like flikr rss gadgets in vista that want to use a other size)
Originally posted 6 weeks ago.
(
permalink
)
Fam. Snoeren edited this topic 6 weeks ago.
|
 |
You need to look in the Regex's and edit the "replace with" strings. I think in your case, you just need to delete intances of suffix "_o" to get an image 500px on the longest size.
Other suffixes, as you may have seen, are here.
Originally posted 6 weeks ago.
(
permalink
)
Ian Chappel edited this topic 6 weeks ago.
|
 |
@Famile: here's a pipe that will let you change the size of the photos in a feed. It would be easy to combine it with altos's pipe if you wanted.
Posted 6 weeks ago.
(
permalink
)
|
 |
@Ian
it would be _b.jpg for the 1024x681 one
@earrh2marsh
that is exactly the option fields that I suggested but I cant do it easyly, I am very new to this :)
Posted 6 weeks ago.
(
permalink
)
|
Would you like to comment?
Sign up for a free account, or sign in (if you're already a member).
|
|