DeviationView - danopia/deviantart-difi GitHub Wiki

More information about this class can be obtained by studying the deviantart-network.js file.

getExtrasHTML

Used to load a deviation's page, including comments and descriptions. Probably also includes the deviation itself for literature (TODO).

Usage

  • When loading a deviation with a hashtag on the URL.
  • Clicking a deviation on a browse page.
  • Viewing a draft on sta.sh.

Params

  • deviationid: number
  • ???: string (""), doesn't appear to do anything
  • extras_parameters: array ([], may contain "offset":"100")
  • extras: object (below entries are OPTIONAL, but this hash needs to exist)
    • is_referred: boolean (i.e. 0)
    • origin: string (i.e. "dynamic_first_click","dynamic_nav_click")
    • is_new_tab: boolean (i.e. 1)

Response

Returns a heck of a lot of HTML in the Dialog style, except instead of html there's html_col1 and html_col2. Also includes a pageData object with some useful data.

{"html_col1":"<div id=\"artist-comments\" class=\"\"> . . .    <\/div>\n    ",
 "html_col2":"        <div class=\"iconset-art icons vicons devlinkzone\"> . . .<\/iframe>\n        <\/div>",
 "css":"",
 "downloads":{ . . . },
 "dwaitcalls":[],
 "pageData":{
   "deviationid":196717409,
   "catpath":"photography\/nature\/sky",
   "pimp_deviation_artist":"nicicolourful",
   "deviation_width":"900",
   "deviation_height":"675",
   "addtofavs_abtest":"below",
   "pimp_me":"danopia"},
 "deps":[
   ["v6core.css","http:\/\/st.deviantart.net\/css\/v6core.css",89880295906,{"media":"Screen,Projection,TV"}],
   ["v6core_jc.js","http:\/\/st.deviantart.net\/css\/v6core_jc.js",113139965228,null],
   ["v6loggedin_jc.js","http:\/\/st.deviantart.net\/css\/v6loggedin_jc.js",37535503162,null]],
 "title":"Sunrise by ~nicicolourful"}

getMainHTML

Seen in the wild when a full packet capture wasn't running. Was called along with getExtrasHTML.

Usage

  • Not sure (TODO)

Params

  • deviationid: number

Response

Returns a Dialog and some deviation info. An image URL can be scraped from the HTML if you want it.

{"html":" . . . ",
 "downloads":[],
 "title":"A Cabin on the Lake by ~Coz-man on deviantART",
 "css":"",
 "deps":[],
 "dwaitcalls":[],
 "pageData":
  {"deviation_height":"683",
   "catpath":"photography/nature/landscapes",
   "deviation_width":"1024",
   "pimp_deviation_artist":"Coz-man",
   "deviationid":190209552}}

getAllGroups

Returns a list of groups a deviation is submitted to

Usage

  • On the deviation submit page?

Params

  • deviationid: number

Javascript Example

var duser = $("div.dev-title-container h1 a.u").html().toLowerCase(); //author's name toLower
var devid = $("div.dev-title-container h1 a").first().attr("href").match(/\d+$/i); //deviation-id
$.ajax({
    mimeType: "text/html; charset=ISO-8859-1", //sometimes some strange behavior without charset...
    url: "http://"+duser+".deviantart.com/global/difi/?c[]=%22DeviationView%22,%22getAllGroups%22,["+devid+"]&t=xml"
}).done(function(data){
    console.log(data)
});

Response

  • On success, a Dialog object.
    scrape for [data-gmiclass="GroupList"] elements and get the following attributes:
    • gmi-groupid: number, e.g. 37826444
    • gmi-groupname: string, e.g. "DeviousBots"
    • gmi-allowremove: number, e.g. 1 if you can remove the deviation from the group, 0 otherwise scrape for .grpicon a img.avatar[src] for the group icon url scrape for .grpicon a img.avatar[alt] for the group icon mention string (e.g. :icondeviousbots:)
      scrape for .grptagline for the group's tagline
      scrape for .grpname to get group's rank and username

getInlineEditor

Usage

  • When you click the Edit button for Deviations you own?

Params

  • deviationid: number

Response

  • On success, returns a Dialog object with the Inline editor elements
  • On fail:
    • error: "Permission Error"

create_from_text_and_edit

Purpose unknown

Params

  • text: string
  • folder_name: string
  • category: string

Example: ["example Literature Deviation text submitted by user","Saved Submissions",""]

getBlankInlineEditor

Returns the Submit page HTML?

Usage

  • When submitting a new deviation?

Params

None

Response

Returns a Dialog object.

Not much of a useful information is present in the response.

getILEPiecesWithDefaults

undocumented

Params

  • deviationid: number
  • ???: string
  • ???: boolean

getILEPreview

Returns HTML for additional options on the Submit page

Usage

Params

  • deviationid: number

Response

undocumented

⚠️ **GitHub.com Fallback** ⚠️