Just a quick post.
Wrote an RSS Feed Generator for DeviantArt Galleries.
To use it, replace yourusername with … your username.
http://www.joeterranova.net/code/deviantart.php?artist=yourusername
Source code is available here.
Brief attempt at a man page.
How it Works
When life gives you lemons, use regular expressions.
I monitored http requests to find DeviantArt’s back end ajax interface (which they use to do previous/next on galleries). From there I wrote a regular expression to parse out each entry, along with entry url, image url, date, and title. From there it’s pretty straight forward.
Keep in mind, I can’t guarantee this will work for you. If it’s been some time since I posted this, you may want to check if they’ve reintegrated rss feeds. That said, unless they change their layout, I doubt they’ll be purposefully breaking this script.
Right now, the only thing it does is get the latest entries from the given user’s gallery — no tags or anything like that. That stuff is probably doable. If you want anything specific, you can a) use the source and change it yourself, or b) leave a comment, and I’ll add it (within reason) when I have time. If you make good changes, let me know and I’ll post them here.
Options:
artist — the artist to get the feed for (ie, your username)
ex: deviantart.php?artist=yourusername
count — the number of items to return. The default is 24. If set higher than your total deviations, it’ll return all of them.
ex: deviantart.php?artist=yourusername&count=10
export — if set, instead of returning an rss feed, it’ll just output the results in an array using var_export. Useful if you’re just trying to get your deviations on your site (and your site uses php).
ex: deviantart.php?artist=yourusername&export=1
nolink — by default, the rss feed will show the thumbnail image as a link back to the main deviation. Add this to disable the link part.
ex: deviantart.php?artist=yourusername&nolink=1
I’ll leave this up, but if I notice real major traffic, I’ll be taking it down and putting it elsewhere (I’ll of course leave the source up). Please don’t do anything silly like hit my url every 10 seconds. For maximum reliability, host it yourself.
If you host it yourself, there’s 3 parameters at the top of the script to change:
$usecurl=1; $url = 'http://www.joeterranova.net/code/deviantart.php'; $webmaster='joeterranova@gmail.com (Joe Terranova)';
$usecurl — set this to 1 to use curl instead of file_get_contents. If your host doesn’t have the curl extension installed and you set this to 1, you’ll get an error — conversely, if your host has remote file opening off (like mine does), and this is set to 0, you’ll get an error.
$url — set this to the url of the script.
$webmaster — set this to your email address and name.
For any questions, comments, or feature requests, leave a comment here. I release this code under the GPL v3 (see code for details).
JoeTerranova.net
Print This Post
sunysky | 07-Mar-08 at 9:38 am | Permalink
does it exist for favorites?
Van | 23-Mar-08 at 8:42 am | Permalink
This is brilliant, thanks Joe. I’ve been trying for 10 minutes now to think of a way to politely pose an email to the DeviantArt admin that their failure to establish a decent RSS system here is pathetic, but I seem to lack the language skills to drive home the urgency of the matter without reverting to calling them a pack of useless fucking pricks. Sigh.
Kol Tregaskes | 26-Mar-08 at 10:28 am | Permalink
Great stuff. Is there a generator for your contacts and even better your favourites?
Josef | 30-Mar-08 at 1:21 pm | Permalink
Fucking brilliant, Joe!!! Thank you very much, this saves a lot of time (I’ll use DA’s feed to feed all my other photo feeds, so the work will be done just one time).
Thank you Joe
Poly | 02-Apr-08 at 6:24 am | Permalink
Man this it’s preety good, but i can suggest you something … Cdata can’t be parsed … so … you can write kind of media:thumbnail istead of Cdata … so i can parse it … or … if you could tell me how can i get parse the link of the photo would be great (in regex ). I need it in Rainmeter if you heard about it , so i can make a skin with photos from deviantart, from a profile (user). Thanks man.
joe | 04-Apr-08 at 8:18 pm | Permalink
@Poly,
Please see the code above. Feel free to edit the script accordingly, as I don’t really understand what you’re talking about …
Isa | 01-May-08 at 12:43 am | Permalink
Right after the idea struck me, I hit google with “deviantart php” and got this as the first result… Thanks ^^
I’m hoping this already does, or can be modified to create a ‘mediastream’ feed that Flock will like.
Basilakis | 19-May-08 at 3:52 pm | Permalink
joe, it seems that deviant has blocked the script or something. It is not working in any case correctly, as it seems that it loads for a lot of time, and then no result. Is it something code like?
Johann | 26-Jun-08 at 6:27 am | Permalink
Dude, you are a genius! Thank you SO Much for this! I’ve been looking for something like this for… well, years!
So, thank you!
Question though: do you have something like this for Journals as well?
Cheers,
Johann.