Members
client
Used to create a twitter client
imageURL
API to fetch random images
Methods
encodeImage(imageURL)
encodes the image to base64
Parameters:
Name | Type | Description |
---|---|---|
imageURL |
string | URL of a random image fetched using Unspalsh API |
getTweet(error, media, result)
this function fetches the random quotes along with greetings and hashtags to tweet
Parameters:
Name | Type | Description |
---|---|---|
error |
object | error occured if any |
media |
object | contains the media file i.e image to be tweeted |
result |
object | final outcome |
postImage(error, image)
this function uploads the image to the twitter.
Parameters:
Name | Type | Description |
---|---|---|
error |
object | represents the error while posting the image to the twitter |
image |
object | represents the encoded image |
tweetNow(status)
it posts the tweet to the timeline
Parameters:
Name | Type | Description |
---|---|---|
status |
object | tweet to be posted |