Badges - danopia/deviantart-difi GitHub Wiki
This class appears to manipulate the badge display on a user's page.
More information about this class can be acquired by studying the badges.js
file.
Seems to check user privs?
- Check user privs to pop sign up if needed
None
Returned null in the wild
REMOVED
– This call seems to have been removed and not used anymore.
Returns a modal Dialog that would give a badge.
- Called/loaded when the "give" button is clicked for a certain badge.
-
badge
: string (i.e."llama"
) -
deviantid
: number (Deviant to give badge to, i.e. 181319)
Returns a typical Dialog object.
REMOVED
– This call seems to have been removed and not used anymore.
Actually gives a badge to a user.
NOTE: Request includes the user's password!
- Called/loaded when the "give" modal dialog is submitted.
-
badge
: string (i.e."llama"
) -
deviantid
: number (Deviant badge was given to, i.e. 181319) -
???
: string ("1") (TODO: redundant badge type? quantity?) -
password
: string (current user's password, used for verification) -
???
: number (1) (TODO: redundant badge type? quantity?) -
???
: number (0) (TODO: cost?) -
???
: string (TODO: appears to be a bytearray and/or checksum?) -
tradeid
: number, 0 if no trade (i.e. 8919)
Returns some info on the target, their badge, and a notification.
{"user":
{"userid":181319,
"username":"snowmask",
"realname":"... DANGER ZONE!!",
"joindate":"1001220377",
"symbol":"`",
"usericon":"57",
"gender":"f"},
"badge":
{"id":null,
"typeid":1,
"name":"llama",
"title":"Llama",
"description":"Llamas are awesome!",
"html":"<div class=\"badge-stack badge-variant-normal badge-llama\" title=\"Llama: Llamas are awesome!\" name=\"gmi-GBadge\" id=\"gmi-GBadge\" data-gmiclass=\"GBadge\" gmi-badgetypeid=\"1\"><img src=\"http:\/\/st.deviantart.net\/badges\/llama.gif\" alt=\"\" \/><\/div>",
"rules":["This badge can be given by you only once to each person."],
"position":null,
"url":"http:\/\/.deviantart.com\/badges\/llama\/"},
"tradeid":8919,
"quantity":1,
"html":" <div class=\"modal-dialog badgeModal\" id=\"givebadgeModalReceipt\" style=\"display:none;\"> . . . <\/div>",
"url":"http:\/\/snowmask.deviantart.com\/badges\/361\/"}
DeviantArt allows a user to "lock" a Llama Badge in a certain level. To do so, you need to open the Llama Badge page in your badges page, and click on a Llama level.
- When switching Llama levels
-
user_id
: string (e.g. "27200967") -
badge_id
: string (e.g. "10622930") -
threshold
: is the number of Llama level (e.g. "1000" for Fancy Llama, or "0" to unlock.)
NOTE: The number of Llama level is accessible via the rel=""
attribute on the level link.
Buys the bowtie and sunglasses accessory for Llama Badges?
-
user_id
: string (e.g. "27200967") -
badge_id
: string (e.g. "6905452") -
aid
: ??? -
userpass
: ??? -
tosagree
: integer (e.g. 0 or 1)
TODO
Toggles the bowtie and sunglasses accessory for Llama Badges?
-
user_id
: string (e.g. "27200967") -
badge_id
: string (e.g. "6905452") -
aid
: ???
The same as the featureBadge
response.
This removes a badge to from "featured badges" section on your userpage. This must be sent with the POST method.
- When removing one Badge from Featured Badges
-
user_id
: string (e.g. "27200967") -
badge_id
: string (e.g. "10622930")
To find the badge_id
, please refer to the featureBadge
method's parameters section.
The same as featureBadge
response.
- When clicking "Clear all featured badges"
-
user_id
: string (e.g. "27200967")
null.
Removes a trade?
- Seen on the llamatrade page. Not sure what does it do.
-
trade_id
: number (e.g. "206072")
TODO
{
"status": "FAIL",
"content":
{
"error": {
"code": "ERR_TRADE",
"human": "Can not delete that trade."
}
}
}
This adds a badge to your "featured badges" section on your userpage. This must be sent with the POST method.
- When featuring a badge in the badges page of a user
-
user_id
: string (e.g. "27200967") -
badge_id
: string (e.g. "6905452") -
newpos
: string (e.g. "1")
The Badge id can be found on the /badges/ page of a user's profile. If you click on a badge, then you'll be taken to a page like http://spyed.deviantart.com/badges/1/. The number in the URL is the badge ID.
-
id
: number (e.g. 6905452 or 13043542) -
typeid
: number (e.g. 1 or 17) -
name
: string (e.g. "Llama" or "cake") -
title
: string (e.g. "King Llama" or "Delicious Cake") -
description
: string (e.g. "Llamas are awesome!" or "Delicious Cake") -
html
: string , e.g.:
<div class="badge-stack badge-variant-normal badge-llama" title="King Llama: Llamas are awesome! (4638)" name="gmi-GBadge" id="gmi-GBadge" data-gmiclass="GBadge" gmi-id="6905452" gmi-badgetypeid="1" gmi-position="3" gmi-owner="27200967"><img src="https://st.deviantart.net/badges/llama_king.gif" alt="" /></div>
-
rules
: array (e.g.: ["This badge can be given by you only once to each person."] or ["This badge is delicious!"]) -
position
: string (e.g. "3" or "2") -
url
: string (e.g. "https://www.deviantart.com/drsdavidsoft/badges/6905452/")