Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Edgar097
Copy link
Contributor

@Edgar097 Edgar097 commented Jun 23, 2021

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?

  • Make run
  • add new sponsor/lifebank
  • Check if my profile posted a twit

@Edgar097 Edgar097 added the dont-merge DO NOT MERGE YET label Jun 23, 2021
@Edgar097 Edgar097 removed the dont-merge DO NOT MERGE YET label Jun 30, 2021
@Edgar097 Edgar097 self-assigned this Jun 30, 2021
Copy link
Member

@leisterfrancisco leisterfrancisco left a 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

},
"twitterText": {
"sponsorNews": "Nuevo patrocinador! ",
"sponsorThanks": ", gracias por ser parte de esta iniciativa",
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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

@leisterfrancisco leisterfrancisco removed their request for review November 1, 2021 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic shares on Twitter when adding new lifebank or sponsor
3 participants