User - danopia/deviantart-difi GitHub Wiki
Loads the dynamic Give Menu on a user's page.
- When loading the Give menu on any page.
- To see whether a user can be given certain badges (e.g. Llamas, Cakes, etc).
-
username
: string, the target profile (e.g. "BrenTayB")
Returns a Dialog object, which resembles:
{"css":"",
"downloads":[],
"dwaitcalls":[],
"pageData":[],
"deps":[
["v6extra.css","http:\/\/st.deviantart.net\/css\/v6extra.css",32862160907,{"media":"Screen,Projection,TV"}],
["v6core.css","http:\/\/st.deviantart.net\/css\/v6core.css",89880295906,{"media":"Screen,Projection,TV"}],
. . .
["drawplz_brushes_jc.js","http:\/\/st.deviantart.net\/css\/drawplz_brushes_jc.js",61771183451,null]],
"title":null,
"html":" <div class=\"pager2\" style=\"display:none\"> . . . <\/div>\n "}
This API can be used to determine whether if a target user is eligible to receive a llama badge from the current logged-in user, since llama badges can be given to a target user only once. You can replicate this behaviour with a POST request in userscripts.
For example, the One-click Llama Button script uses its own mechanism to check if the user has been already given a llama.
Another script called Amall uses the native [DiFi object] calls to achieve the same results.
DiFi.pushPost("User","getGiveMenu",[u],function (success, data) {
if (success&&data.response.content.html.indexOf("Give a <span>Llama Badge")===-1)
$(".amall-give[pruf="+u+"]").addClass('amall-already').removeClass('amall-working');
});
DiFi.send();
Gets a list of your friends.
Whenever clicking on the "Friends" icon, either on:
- The profile page
- Composing a new Note
- Sending group invitation to a Friend
-
???: number (e.g.
1
) -
page
: number (e.g.1
)
Returns an array containing an object for each friend. e.g.:
{
"groupid": "0",
"username": "dADroid",
"realname": "The dADroid-bot account",
"symbol": "~",
"usericon": 6,
"groupname": "",
"lastvisit": "Online",
"avatar": "https:\/\/a.deviantart.net\/avatars\/d\/a\/dadroid-bot.png?3"
}
Checks if a certain username does not already exist on the site.
- At the new account registration page.
-
username
: string, the target username (e.g.. "spyed")
Returns content
with a boolean value: true
if the username does not exist, false
if the username is already taken.
Removes ads from the site for a limited time (e.g. 24 hours).
This was discovered on June 18th, 2011 and last tested on January 15th, 2019. This method probably won't work anymore in the future.
None
- On success,
null
- On fail, possible errors are:
-
error
: User already has no ads -
error
: User has already claimed the offer
-
Sets your user online status.
- Called when you change your status in the UI, i.e. to online or offline.
-
status
: number.- 0: online
- 1: invisible
- 2: invisible, "even in private messages"
Returns null
on success, object with user-friendly 'error' key on error
Set option to show birthday publicly
unknown
-
user_id
: number -
dob_public
: number (0 = don't show, 1 = month and day, 2 = show full age/birthday) -
dob
: date of birth in year-month-day format
undocumented
Get your current status (Online/Invisible).
None
- 0 = Online
- 1 = Invisible
Sets details on welcome page
-
user_id
: number -
type_id
: number (related to things like "Software Developer") -
country_id
: number (country id on welcome page)
undocumented
When signup guide is done
-
done
: number (1)
Resets avatar?
unknown
-
user_id
: number
- On success, undocumented
- On fail, possible errors are:
-
error
: No such gruser
-
Sets avatar?
- When adding a new avatar.
-
user_id
: number (e.g.: "37591934") -
deck_id
: number (i.e. 572832117) -
position_x
: number (e.g.: "0") -
position_y
: number (e.g.: "0") -
position_dx
: number (e.g.: "50")
-
avatar_url
: string, a link to the new user avatart image. e.g.:https://a.deviantart.net/avatars/d/a/dadroid-bot.gif?2
This number could be acquired by uploading the file as deck_file
field to this URL:
https://www.deviantart.com/global/deckpost.php?nowrap=1
After uploading the file, you'll get a reponse like this:
{
"deckId": "572832117",
"status": "1",
"name_long": "my_avatar.gif",
"is_displayable": true,
"is_video": false,
"is_printable": false,
"is_text": false,
"file_type_str": "gif",
"file_size_str": "13 KB",
"width": "50",
"height": "50",
"preview_url": "https:\/\/tmp00.deviantart.net\/d03f\/t\/2018\/355\/0\/2\/022fda7b923d2ddbda129dfd1fcd7a40.gif",
"thumb_url": "https:\/\/tmp00.deviantart.net\/d03f\/t\/2018\/355\/0\/2\/022fda7b923d2ddbda129dfd1fcd7a40.gif",
"name_short": "my_avatar.gif",
"suggested_size": 0,
"text_preview": null,
"sizeArray": ["Original Size (50 × 50 pixels)"],
"frames": [],
"attributes": "516",
"attributes2": "0",
"validate_token": "39e6e6b892571677d905",
"validate_key": "1545385039"
}
You can then use deckId
(e.g. "572832117") to set your avatar.
Unknown
Related to User::setAvatar
.
-
unknown
: id -
unknown
: id
undocumented
Adds the username to the blocked users list.
- When the "Block User" option on a comment is selected.
-
username
: The selected username to be blocked.
Returns null on success.
Removes the username from the blocked users list.
-
username
: The selected username to be blocked.
Returns null on success.
undocumented
unknown
deviationid
undocumented
Purpose Unknown
- When an advert has finished downloading?
None
Returned null in the wild.
Returns formatted user name and a link to the avatar.
- Seen in combination with the auto-complete.
-
userget
: array containing usernames
An associative object, e.g.:
{
"spyed": {
"username": "spyed",
"link": "<span class=\"username-with-symbol u\"><a class=\"u admin username\" href=\"https://spyed.deviantart.com/\">spyed</a><span class=\"user-symbol admin\" data-quicktip-text=\"DeviantArt Staff\" data-show-tooltip=\"1\" data-gruser-type=\"admin\"></span></span>",
"avatar": "https://a.deviantart.net/avatars/s/p/spyed.gif"
}
}
Returns HTML with a list and explanation of all membership levels, with your own membership level at the end
None
Returns a Dialog object.
Hides/shows left sidebar on http://www.deviantart.com/browse/all/
-
closed
: boolean
Checks if the user has verified their email address
- Seen on the
VerifyModal
.
None
Returns true
if the user is verified. Otherwise, returns false
.
Returns the VerifyModal
and the verify ribbon bar.
None
- On success, returns a [Dialog]-like object.
- On error:
error
: "Verification is unnecessary"
Age validation when viewing a mature Deviation as an unregistered user.
- year?
- month?
- day?
deviationid
undocumented
None
Returned false in the wild.
undocumented
None
Returned false in the wild.
Purpose unknown
undocumented
-
newbie_username
: string
Returned false in the wild.
undocumented
-
newbie_username
: string
undocumented
Returns very basic user information (username
, symbol
, usericon
, usericonurl
, is_test_group
)
- For the commission widget?
None
-
username
: string, e.g. "danopia" -
symbol
: string, e.g. "" -
usericon
: string, full address to user avatar -
usericonurl
: string, full address to user avatar -
is_test_group
: boolean, e.g. TRUE
For the commission widget?
- float
- boolean
- boolean
- [string]
Changes the default units of a user between metric and imperial.
unknown
-
unitid
: number (e.g. 0 for metric, 1 for imperial)
Returns null on success.
Changes a user's default currency.
unknown
-
currency
: int
undocumented
undocumented
None
Returned null.
REMOVED
Doesn't seem to work any more.
type
content
desc
-
url
i.e. window.location.href
undocumented
- On success, undocumented
- On fail:
-
error
: This DiFi call is only available through OAuth2
-
Returns address to the user avatar.
- Encountered when trying to find a Deviant for the "Give one, get one" action in the Notifications.
-
username
: string
- On success, returns the complete URL for the user avatar.
- On fail:
-
error
: User does not exist.
-
undocumented
None
undocumented
year
month
day
- unknown
Purpose unknown
undocumented
None
undocumented
Seems to be related to the overhead in the mobile
undocumented
-
???
: string (e.g.show
orcancel
)
undocumented