This isn't strictly a plugin but I think this is probably the best forum for it.
I recently decided to switch away from Flickr as I wasn't making good use of it and, after trying a few options, found Zenphoto to my liking. I wanted to bring over my Flickr photos but I couldn't remember everything I had uploaded, and I didn't want to lose all of the time I had put into describing and tagging the photos, so I wrote a script to grab the photos and meta data and create albums in Zenphoto and entries in the appropriate tables.
As this may prove useful for someone else I thought I would make it available for others, so you can
download it here.
Comments
http://www.zenphoto.org/2008/01/importers-and-exporters/#flickr-importer
Thanks for your code. I was exactly looking for a feature like yours. Now I am trying to install everything by following your readme.txt file. It says that I have to upload the auth folder into a web accessible directory.
But... ther is no auth folder in the package that you provided.
Can you help?
Looking forward to your reply.
Cheers, Stinie
Good point, well spotted, I forgot to include it. I have updated the file to include it, as before you can download it here.
Regards
Lee
It generates the following error messages when I run it:
[23-Aug-2009 14:11:32] PHP Warning: require_once(/home/packa2/public_html/photos/zp-core/zp-config.php) [function.require-once]: failed to open stream: No such file or directory in /home/packa2/public_html/photos/zp-core/plugins/flickr_importer/flickr_import.php on line 32
[23-Aug-2009 14:11:32] PHP Fatal error: require_once() [function.require]: Failed opening required '/home/packa2/public_html/photos/zp-core/zp-config.php' (include_path='.:/usr/lib/php:/usr/local/lib/
php:/home/packa2/public_html/photos/zp-core/plugins/flickr_importer/PEAR') in
/home/packa2/public_html/photos/zp-core/plugins/flickr_importer/flickr_import.php on line 32
I looked at line 32, but the strpos command that appears to be the problem is meaningless to me. I poked around the intertubes to see if I might stumble across something, but no luck so far.
Any ideas as to what the problem is?
I'm at the same point as chrisabo; I've successfully installed zenphoto, as well as the flickr importer, and everything seemed to be functioning until a few dozen photos into the very first set, when i get:
..........error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's photographs' AND comment='i like this alot. a whole lot.'' at line 1
the first time it happened the error was slightly different, and centered around a different comment on a photo; so i went to flickr and deleted that image completely, only to have it deliver the same error, so i went back to flickr and made that set last, so that the importer would work on others before it got to it.
a few dozen images into the 'new' set, it delivers the error pasted above, and i now have come to the conclusion that there's possibly something about the data involved in user comments (or commentor's names) on flickr that the script can't handle, or else it just times out somehow and has happened to do so midway through a comment.
there weren't any special characters or anything else strange i know about in the first image's comments that were giving it trouble; i can't really figure out which image is giving it trouble now.
I have a little under 13,000 images on flickr, and i've been trying to backup my flickr stream for the last two months now, using a dozen different third party tools that don't actually work as claimed, and also plugins similar to this on fresh installs of drupal, wordpress, and gallery2 software. I can assure you that if this tool could be tweaked a bit to overcome this error, a great many people would benefit from its use, and zenphoto itself would make a lot of converts, since there's really nothing else out there that does the job.
thanks
however, i've again moved sets around on my flickr stream and this time i was able to track down a specific example of the error. here's what the flickr importer says this time:
.error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's My Stabbing Knife' AND comment='a) those are some dang glossy leaves and a wel' at line 1
which is in relation to this photo (that i've just made public so that you can see it):
http://www.flickr.com/photos/maproomsystems/2261488602/in/set-72157603904798901
the specific comment i think it got hung up on is the one by "that's my stabbing knife" here:
http://www.flickr.com/photos/maproomsystems/2261488602/#comment72157603930258097
and i do realize this is an 'unsupported' extension, but if nothing else, you might want to reconsider adding it to the extensions page if there is no evidence that someone has been able to actually use it successfully.
thanks
Updating to newer Zenphoto or even Flickr versions is in the responsibility of the developer. If something does not work anymore it still might be of use as a starting point for something new. Maybe you want to try yourself?
I've sent a message to Lee (the author), requesting his attention.
As for the matter of me, personally, building upon the code, i can assure you that if you were aware of my level of experience, training, interest, and aptitude in that department, you would not wish for me to touch it with a ten foot pole.
OK, Chrisabo's issue looks to be because it can't find the zp-config.php file, double check it exists.
As for Brett's, that seems to be an issue with apostrophes in the commenter's name, which I think I've sorted with a quick one-line change.
You can download a new copy of the flickr_import.php file here, just save it over the new one and give it another go, let me know how you get on and I'll update the package if it solves it.
Lee
i've been working on this pretty much non-stop since your message came in, hence the delay. currently i'm 7371 images into it, having re-run the process a dozen or so times.
I've only received one consistent error in the course of using the new script, which is:
Warning: Invalid argument supplied for foreach() in /home/maproom/public_html/zenphoto/zp-core/plugins/flickr_importer/flickr_import.php on line 315
unlike the earlier errors, it's only referencing the import script so i'm not too sure what might be triggering it.
i realize sbillard already addressed it, but when I first ran the script yesterday I initially got an error message identical to Chrisabo's above, and figured out that your script was calling for a zp-config.php file located in the zp-core directory, and after much hunting realized that zp-config.php was actually placed in zp-data. So, not knowing whether it would hurt anything, I just made a copy of it so that there was one in both zp-core, as well as leaving the original in zp-data.
It didn't seem to break anything, and it stopped the error from happening, but as i've said i don't know enough to be certain that some other plugin or feature might not get totally messed up by having the two duplicates there.
your change regarding the apostrophes worked like a charm, and everything else seems to be downloading correctly, albeit slowly, for which my webhost's server may be primarily at fault.
Thanks again for the quick fixes, let me know if i can try anything to help clear up that final bug, and i'll leave a comment here tomorrow to give a final update about whether everything made it through.
`require_once($path . "zp-data/zp-config.php");`
(I assume the plugins remain in the zp-core folder for the time being? Sounds like it'll need another change when 1.2.7 comes out as the plugins will have moved too)
The other error you're receiving, Brett, is a warning that one of the loops when is empty when entering comments, it shouldn't get that far, but it's only a warning so it won't be affecting the execution. I'll see if I can figure out why it's not being caught.
with the exception of several hours of sleep, i've been working on this non-stop for the last two days.
i've run the script several hundred times, and it simply doesn't seem capable of making it all the way through this many sets and photos. all the images and comments in my first 60 (out of 70 total) sets on flickr are downloaded to zenphoto, but then when i re-run the script, it takes 20+ minutes to go back through all of them again and check that it's definitely downloaded them (a great idea, in theory), but that checking in and of itself is enough to get it to 'run out of steam' and deliver its 'done' message. on many of the last times i ran it, it would end up only downloading one single image, or sometimes none at all.
much more importantly, though:
after having invested this amount of time, i have just realized that it has, all along, only been downloading flickr's resized 'medium' images, which are 500 pixels wide. so, as of right now, i have a zenphoto installation with a little over 11,000 images in it, but they're all basically glorified thumbnails, unsuitable for printing or viewing in detail. Additionally, I've checked several dozen of their properties, and many of them have been stripped of exif data, keywords, and even the date taken.
also, each of my videos on flickr was imported as a still image. i'm not sure that video uploads was an intended function of the script to begin with, and i personally don't have much concern about them, but it's certainly a feature that other users might want.
so...
i'm not sure where, exactly, the setting is that determines what size image is downloaded, and i honestly can't say that even if that can be adjusted, unless there is also some way to extend the 'timeout' function so that one doesn't have to keep monitoring the progress and re-running it several times an hour, that i'll be able to maintain patience for this process much longer, considering that it will no doubt take infinitely longer to download the full size images as opposed to the ones i've just spent several days on.
i hope that you can understand my frustration, especially when you consider that i've tried a dozen other alternatives over the last couple months, and spent hundreds of unsuccessful hours trying to accomplish what, as i've said above, is a very commonly needed function.
From the philosophical perspective of 'open source' software, it really is totally bizarre to me that a solution to this problem seems so hard to find.
as you might know, flickr has been used time and time again by the creative commons community as the poster child for 'Free Culture', but in reality it's more accurately characterized as an example of the malevolence of Cloud Computing and DRM. The longer you stay, and the more you contribute to it, the harder it becomes to extricate your data from their system.
as i've said earlier, since zenphoto is largely meant to be a standalone alternative to such systems, and since there is increasing discomfort in the flickr community regarding, among other things, yahoo's attempts to control and monetize it, i suspect there will soon be many other users showing up in this forum, hoping to solve the very same problem i have.
I do apologize for the rant.
With some tweaking, i still believe this importer could be the best available method to serve the intended function, and i'm not giving up on it, just yet, so long as it seems like there's interest in its development and improvement.
my itemized personal suggestions would be-
1) solve the matter of downloading the original file size,
2) somehow increase the length of time that the script can run, so that it doesn't require as much manual refreshing,
3) possibly to augment the need for #2, offer an independent selection method where one can specify an individual set, or group of sets, tags, etc, and so bypass the need for the script's back-checking of things that you know have already been downloaded.
4) i think the failure to capture all the addtl metadata is probably just due to the timeouts, so fixing #2 and #3 would probably take care of that, i hope.
5) and, since zenphoto supports various video formats, it does seem like other users might want an import method for those, as well.
anyway, thanks again, lee and acrylian, for your help and patience.
This appears to be a really old topic and yet I can't imagine I'm the only one since the Fall of '09 to still need this functionality.