Description

Twitter API methods.

This module includes all available API endpoints that can be called from this extension <-> Twitter server.

This module must run in the browser tab within the Twitter web app context (twitter.com), to populate the correct request headers.

Details

Methods


<static> mapUser( description, screen_name, id_str, name, profile_image_url_https )

Description

Map Twitter API user object to local model

Parameters
Name Type Description
description

bio text

screen_name

handle

id_str

unique id str

name

user's display name

profile_image_url_https

user profile image url

Returns

<static> parseResponse( response, onParse, callback, errorCallback )

Description

Try Parse API response

Parameters
Name Type Description
response string

response from API

onParse function

function to process parse result

callback function

function on call on success

errorCallback function

function to call on error


<static> getTheBio( handles, bearer, csrf, callback, errorCallback )

Description

Request user bios

Parameters
Name Type Description
handles Array.<string>

user handles to check

bearer string

authentication Bearer token

csrf string

csrf token

callback function

handler for successful bio request

errorCallback function

handler when this request cannot be completed


<static> doTheBlock( id, bearer, csrf, user )

Description

Block a specific user

Parameters
Name Type Description
id string

user id str

bearer string

authentication bearer token

csrf string

csrf token

user Object

log entry for blocked user


<static> isBlocking( handle, bearer, csrf, callback )

Description

Check in real-time if user is already being blocked.

Parameters
Name Type Description
handle String

screen name to check

bearer string

authentication Bearer token

csrf string

csrf token

callback function
Returns

True if already blocking and False otherwise