Notes - danopia/deviantart-difi GitHub Wiki
This class is used to interact with Notes (e.g. reading and sending Notes, starring a Note and marking Notes as "read" or "unread".)
Creates a new folder for organizing notes.
- When clicked on "New Folder" on the Notes page.
-
foldername
: string, defaults to "Devious Folder" -
parentid
: number, 0 for a root folder
-
folderid
: number, an id that is assigned to the new folder. -
foldername
: string, the name of the folder.
Purpose unknown
-
note_title
: string -
note_content
: string
undocumented
Deletes a series of notes.
- When one or more Note is selected and then the "Delete" button is clicked
-
noteids
: array of numbers, e.g.["2103797848", "2106267368"]
.
Returns an object with counts.1
containing the new amount of messages in the inbox, if applicable.
Deletes a custom folder, moving all messages inside to folder 1
(inbox).
-
folderid
: number.
Returns an object repeating your folderid
, and counts.1
containing the new amount of messages in the inbox, if applicable.
undocumented
-
templateid
: number.
Searches Notes for a certain word or attribute.
- When a query is entered into the search bar on the Notes page.
-
query
: string, search text (e.g. "foo") -
from
: array, containing usernames (e.g.["spyed"]
) -
to
: array, containing matching recipients (e.g.["jark"]
) -
folders
: array, containing matching folderids (e.g.["106218"]
) -
statuses
: ??? -
offset
: number, e.g. 25.
Response is similar to display_folder
.
Loads a Notes folder.
- When navigating Notes (e.g. opening a custom folder, or switching to the inbox).
- When loading the initial Notes screen.
- When deleting a note, which causes the Notes to reload.
-
folderid
: number/string, e.g.0
for spam,1
for inbox,2
for sent, as well as strings such as 'starred', 'drafts', 'unread', or an integerfolderid
for custom folders. -
offset
: number, e.g. 0 -
deselectnote
: boolean, e.g. true
TODO: Currently, it is unknown what purpose deselectnote
does serve.
Returns basic info. Resembles a Dialog but the content is in body
instead of html
.
{"html":null,
"folderid":"1",
"downloads":[],
"title":null,
"css":"",
"deps":[],
"dwaitcalls":[],
"deselectnote":true,
"pageData":[],
"offset":0,
"body":" \n <div class=\"h\" id=\"current-folder\"> . . . <\/div> <!-- #current-folder -->\n "}
var folder = 1, offset = 0;
DiFi.pushPost('Notes', 'display_folder', [folder,offset,true], function (success, data) {
if (data.response.status == 'SUCCESS') {
console.log(data.response.content.body);
}
});
DiFi.send();
Returns the HTML view of a note.
- When a Note is clicked on
- On the initial page load
-
folderid
: number/string. (e.g. 0 for spam, 1 for inbox, 2 for sent.) -
noteid
: number, e.g. 2112292244
-
On success, returns a two-field object:
-
noteid
: your request note id -
body
: contains the HTML to view the note, e.g.:<div id="current-note"> . . . </div>
Tip: To scrape for content, parse for the following elements:
-
span.mcb-title
: note title -
div.mcb-body wrap-text
: html body -
textarea.mcb-body
: raw body -
span.mcb-ts
: note time (title has absolute time, content had relative time) -
div.mcb-whoicon
: contain's sender's username, avatar and profile link
-
-
-
On error:
-
error
: "Could not load the note"
-
Mark a series of notes as "read".
-
noteids
: array of numbers.
Returns the array of note IDs in noteids
and the new unread count in count
.
Mark notes as "unread".
-
noteids
: array of numbers.
Returns the array of note IDs in noteids
and the new unread count in count
.
Moves some notes to a new folder. Errors if they're already there, apparently.
-
noteids
: array of numbers. -
folderid
: number.
Returns an object with as a key for every folder involved, with the new message counts as the values.
No-operation call. Used to make sure the user can send a note before he goes through the trouble of typing it all out.
- Called when the "Send a Note" menu is clicked (on a user profile).
None.
Returns null on success.
Previews a note's formatting, optionally including your signature.
- When previewing a note.
-
note
: string -
signature
: boolean, includes your signature in the note
Returns an HTML string.
The request "Hey! :iconrickrollplz: :devart:",true
returns the following:
Hey! <a href="http://rickrollplz.deviantart.com/"><img class="avatar"
src="http://a.deviantart.net/avatars/r/i/rickrollplz.gif?4"
alt=":iconrickrollplz:" title="rickrollplz"/></a>
<img src="http://e.deviantart.net/emoticons/d/devart.gif"
width="32" height="17" alt=":devart:" title="deviantART"/><br /><br />--<br />
Hackers are not criminals. Hackers are the only people out there to keep crackers and virus
coders on the run. Hackers are misconstrued by the media, but in reality, they do not cause
damage or steal. Hackers keep the Internet safe from those who don't.
(Like my sig?)
Renames an existing folder.
-
folderid
: number, the folder to rename -
foldername
: string, the new name
Returns the foldername
as well as a folderid
.
Saves a note in your drafts for later editing and sending.
-
recipient
: string, user to address to -
subject
: string, the note's title -
body
: string, the content -
draftid
: number, 0 to create a new draft, or a given id to update an existing draft
- On success, returns the
noteid
and the newcount
:-
count
: int, the number of new drafts -
noteid
: int, either the new draft id, or the updated draft id
-
Marks a series of notes as "starred".
-
noteids
: array of numbers.
Returns the array of note IDs in noteids
and the new starred count in count
.
Marks a series of notes as "unstarred".
-
noteids
: array of numbers.
Returns the array of note IDs in noteids
and the new starred count in count
.
Purpose unknown
-
template_to_update
: string -
title
: string -
content
: string
undocumented
Purpose unknown
unknown
-
username
: string -
item_type
: number? -
item_id
: number -
admin_id
: number -
message
: string
undocumented
Moves a single note?
-
path
: string (folder?) -
messageid
: number
Deletes a single note?
-
messageid
: number
undocumented
Loads a draft note to display.
- Called when browsing the draft notes.
-
messageid
: number
- On success:
-
noteid
: number -
subject
: string -
body
: string -
recipients
: array containing usernames
-
- On error:
-
error
: "Could not load the draft"
-
Displays a note?
-
messageid
: number
undocumented
undocumented
Purpose unknown
Changes the unread value for a single note.
-
noteid
: number, e.g.2087135593
-
is_unread
: boolean, i.e. false for not not read, true for read
-
count
: number of new unread notes, e.g.7
. -
noteids
: array containing the note ids.
Changes the starred value of a series of notes.
-
noteid
: array containing ints, e.g.["2087135593"]
-
is_starred
: boolean, i.e. false for not starred, true for starred
-
count
: number, the count of new starred notes, e.g.28
. -
noteids
: array containing the note ids.
Reports the note as spam. The spam flag cannot be removed even after the note is moved out of the spam folder, unless an administrator takes action.
- Called when the user clicks on "Mark as... → Spam".
-
noteid
: array containing numbers, e.g.[2087135593]
Returns an associative array with the new folder counts.
This method is used to send a deviation or share items (such as forum posts) to someone in a note.
- When sharing a Deviation with someone.
-
type
: string (e.g. "deviation" or "forum") -
itemid
: number (e.g. post id, or deviation id) -
username
: string, the recipient username (e.g. "danopia") -
message
: string, the pimp message (e.g. "Check out this awesome deviation!")
NOTE: The note subject will be picked up from the item's title (e.g. the Deviation title), and the "pimped" item will be prepended to message
in the note body.
undocumented
Results in a "You've Received a Valentine!" Note for the recipient
- Used when sending Valentines Deviations to other Deviants.
-
note_id
: number? -
username
: string -
message
: string
undocumented