├── .htaccess ├── README.md ├── getDeviations.js ├── getDeviations.php ├── javascript.php ├── php.php └── styles.css /.htaccess: -------------------------------------------------------------------------------- 1 | DirectoryIndex php.php -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # deviantART-API 2 | 3 | Use DeviantArt's RSS/XML feeds as a CMS to dynamically embed deviation galleries on your website. 4 | 5 | DeviantArt users can create Gallery Folders to organise their deviations (e.g. http://fu51on.deviantart.com/gallery/) 6 | 7 | This script returns the [data](#what-data-does-the-feed-provide) from all the deviations from the specified folder. 8 | 9 | ## What is the URL of the feed and its parameters? 10 | 11 | The RSS URL always begins with: `https://backend.deviantart.com/rss.xml` followed by some query parameters, e.g. https://backend.deviantart.com/rss.xml?q=gallery:fu51on/27123391 12 | 13 | [DeviantArt's RSS documentation](https://www.deviantart.com/developers/rss) only provides a couple of examples of how to construct RSS URLs. 14 | 15 | Here is an expanded list of query parameters: 16 | 17 | | Query params | Example | Description | 18 | | :- | :- | :- | 19 | | `q=by:[deviant name]` | `q=by:fu51on` | 20 | | `q=gallery:[deviant name]` | `q=gallery:fu51on` | 21 | | `q=gallery:[deviant name]/[gallery]` | `q=gallery:fu51on/27123391` | 22 | | `q=[search term]` | `q=frogs` | 23 | | `q=in:[category]` | `q=in:visual_art` | 24 | | `offset=[number]` | `offset=60` | 25 | | `order=[number]` | `order=5` | Order by newest | 26 | | `order=[number]` | `order=9` | Order by all-time popularity | 27 | | `limit=[number]` | `limit=10` | 1-60 | 28 | 29 | ## How can I get the Featured and Scraps galleries? 30 | 31 | Please see https://github.com/jamesl1001/deviantART-API/issues/4#issuecomment-1951384692 32 | 33 | ## What data does the feed provide? 34 | 35 | - title 36 | - link 37 | - permalink 38 | - date 39 | - keywords (doesn't seem to return anything at the moment) 40 | - rating 41 | - category 42 | - deviant's name 43 | - deviant's avatar 44 | - copyright 45 | - description 46 | - thumbnail (w: 150) 47 | - thumbnail (w: 300) 48 | - deviation 49 | 50 | ## Usage - PHP 51 | 52 | **Example** 53 | ``` 54 | 58 | ``` 59 | 60 | `getDeviations()` returns an array of objects containing all the data about each deviation from the provided gallery folder. 61 | 62 | You can use a foreach loop to extract the data you require: 63 | ``` 64 | 68 |
= $deviations[$i]->title; ?>
69 |https://github.com/jamesl1001/deviantART-API
13 |Use DeviantArt's RSS/XML feeds as a CMS to dynamically embed deviation galleries on your website.
15 |Feed: https://backend.deviantart.com/rss.xml?q=gallery:fu51on/27123391
16 | 17 |https://github.com/jamesl1001/deviantART-API
13 |Use DeviantArt's RSS/XML feeds as a CMS to dynamically embed deviation galleries on your website.
15 |Feed: https://backend.deviantart.com/rss.xml?q=gallery:fu51on/27123391
16 | 17 |= $deviations[$key]->date; ?>
34 |= $deviations[$key]->desc; ?>
35 |Rating: = $deviations[$key]->rating; ?>
36 |Category: = $deviations[$key]->category; ?>
37 |By = $deviations[$key]->deviantName; ?>
38 |= $deviations[$key]->copyright; ?>
40 |