Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

5 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Twitter Bot

This is a simple bot to search and response twits.

Follow this to install and test this bot.

------ Link to the Twitter Bot Post ---------

Let's get started

First of all we need to access Twitter API.

With this API, you can:

  • Retweet other tweets
  • Retweet and edit tweets
  • Search Tweets on Twitter
  • and simply Create Tweets

First, you’ll need a Twitter account to get access to an API Key (Consumer Key).

How to get it?

1. Create a free Twitter user account

Head over to Twitter.com and register for a free account. This will allow you to access the Twitter developer portal next.

2. Head over to the Twitter Dev Site and Create a New Application

Navigate to developer.twitter.com, sign in, and create a new application.

After that, fill out all the app details and voilá...

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f1f4cb22-7756-49a4-b144-2a90c518f257/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4edb8689-b9e4-436f-ad61-1a00e1340cde/Untitled.png

**A*ccess token will be invalidated if a user explicitly revokes an application in their Twitter account settings or if Twitter suspends an application

You now should be able to access all the required API Keys and authorization credentials.

You should be able to find everything under the “Keys and Access Tokens” Tab for all the Twitter API Key details.

Now that you have a Twitter API Key and all the required credentials, let’s learn how to connect to the API.

How to Connect to the Twitter API

At this point we need to enter the matrix.

This is the repo → link to the public repo lab-botTwitter

Config Twitter credentials API**:**

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bb29d52f-58e7-44df-beec-26147fa226ae/Untitled.png

Se setean los strings de búsqueda y las respuestas a los mismos

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/00a29531-4de5-4709-aa43-7ae48e7dfc99/Untitled.png

Al ejecutar el script se elige un string de búsqueda de manera aleatoria. Y se consulta la api para encontrar twits que macheen.

This is an example to print the search results

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d3277b1b-871e-4f00-bb2b-bd5341b5efef/Untitled.png

How to post the response

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/01e68c15-944f-497f-a953-dd8c2124c87c/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/39320bd0-ae58-4757-8339-35e0ae84e835/Untitled.png

The commandments of a Twitter bot

  • You shall not spam
  • You shall not make advisements
  • You shall not execute more than two or three times per day

Run it whit

composer install

php -S localhost:8080

Whether you want to make a specialized search of profiles or say hello to someone, you will be able to do it with this guide.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages