-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(twitter): automatic tweets #843
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work, just some little changes
hapi/src/language/es.json
Outdated
}, | ||
"twitterText": { | ||
"sponsorNews": "Nuevo patrocinador! ", | ||
"sponsorThanks": ", gracias por ser parte de esta iniciativa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider add exclamation mark as in English version
var responseReturn = {} | ||
var metadataData = {} | ||
|
||
request.get(mediaUrl, function (error, response, body) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it an arrow function
fs.writeFile(PATH, body, function(error) { | ||
if (error) console.error(error) | ||
|
||
T.postMediaChunked({ file_path: PATH }, function (error, data, response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it an arrow function
responseReturn = Object.assign(response) | ||
if (error) console.error(error) | ||
|
||
fs.writeFile(PATH, body, function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it an arrow function
const mediaIdStr = data.media_id_string; | ||
const meta_params = { media_id: mediaIdStr } | ||
|
||
T.post('media/metadata/create', meta_params, function (error, data, response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it an arrow function
if (!error) { | ||
const params = { status: message, media_ids: [mediaIdStr] } | ||
|
||
T.post('statuses/update', params, function (error, response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it an arrow function
Resolves #661
What does this PR do?
Automatic Tweets when adding new lifebanks or sponsors (accept contracts)
in the .env.example I added new variables for the twitter bot you can use my credentials for the time being
https://twitter.com/edgarparra2
How should this be tested?