ActivityFeed - danopia/deviantart-difi GitHub Wiki

This class is used to interact with the user Status Updates.

More information about this class can be obtained by studying the feed.js file.

post_status

Posts a new status message.

Usage

  • When posting a new Status Update from the profile.
  • When sharing an existing Status Update with additional message.

Params

  • submit_content: string, the new content
  • attachment_type: number, 0 for no attachment
    (e.g. 1 if sharing an existing Status Message, 2 if attaching a Deviation)
  • attachment_id: string (e.g. "Username:[id]" or "[deviationid]" or "")
  • attachment_parent: string (e.g. "")

Response

  • On success, returns:

    • statusid: number, the created status id (e.g. 16282019)
    • new_status: string, contains the html to show
      • scrape for .feed-activity-menu-item to get the status url
      • scrape for .time a[title] to get the time
      • scrape for .feed-activity-menu[data-*] to get the username, userid and isagroup
      • scrape for .feed-action-status-content to get the status message
  • On fail, undocumented

edit_status

Edits an existing error message.

Usage

  • When editing a posted Status Update.

Params

  • edit_id: number, i.e. the statusid (e.g. 16282019)
  • submit_content: string, the new content of the status update

Response

  • On success, returns:

    • new_body: string, i.e. the same as submit_content
  • On fail, returns:

    • error: "Status not found"

delete_status

Deletes a posted status message.

Usage

  • To remove a posted Status Update.

Params

  • statusid: number (e.g. 16282019)

Response

  • On success, returns null.
  • On fail, returns:
    • error: "Status not found"

get_edit_form

Returns the html form to edit an status message.

Usage

  • When editing a Status Update on the Watch feed.

Params

  • statusid: number

Response

  • On success, returns:
    • form: string, contains html to build an edit form
      • scrape for .status-form[data-edit-statusid] for the statusid
      • scrape for .status-entry textarea.text[name=statusbody] for entity-encoded status message
  • On fail, returns:
    • error: "Status not found"

preview_status

Returns preview of the status message by parsing all formatting into HTML.

Usage

  • When previewing a Status Update on the Watch feed.

Params

  • text: string

Response

  • On success, returns:
    • body: string, contains html with parsed usernames, emoticons and other dA media.
  • On fail, undocumented

get_new_form

Returns a new empty html form for posting a status message.

Usage

  • When clicked on "Share" button on a Status Update in Watch feed

Params

None

Response

  • On success, returns:
    • form: string, html required to build a form.
  • On fail, undocumented

update_settings

undocumented

Usage

undocumented

Params

  • settings: object

The settings are read from the .feed-settings-setting element.

Response

undocumented