diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27c7716..69b14c1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,7 @@ jobs: - name: execute py script # run app.py env: + NODEMAVEN_PROXY: "${{ secrets.NODEMAVEN_PROXY }}" TWITTER_API_KEY: "${{ secrets.TWITTER_API_KEY }}" TWITTER_API_SECRET: "${{ secrets.TWITTER_API_SECRET }}" TWITTER_ACCESS_TOKEN: "${{ secrets.TWITTER_ACCESS_TOKEN }}" diff --git a/FUNDING.yml b/FUNDING.yml index ff57ceb..484b8d2 100644 --- a/FUNDING.yml +++ b/FUNDING.yml @@ -1,2 +1,2 @@ github: [dhohirpradana] -custom: ["https://mediasiana.id"] +custom: ["https://github.com/dhohirpradana"] diff --git a/README.md b/README.md index ddcf1df..ae00dd9 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,26 @@ Automate change of name and Twitter profile banner using Python code and Github action. # Steps -1. *To get Twitter Keys* -Go to Twitter developer site [Twitter Developer](https://developer.twitter.com "Twitter Developer") and register twitter developer -> Create new project -> Create app -> Keys and token -|key name|description| -|--------|--------------| -|TWITTER\_API\_KEY|The Consumer Key for your Twitter App (this is the same for every user)| -|TWITTER\_API\_SECRET|The Consumer Secret for your Twitter App (this is the same for every user)| -|TWITTER\_ACCESS\_TOKEN|The Public part of an Access Token for your Twitter App (this is different for every user)| -|TWITTER\_ACCESS\_TOKEN\_SECRET|The Secret part of an Access Token for your Twitter App (this is different for every user)| +1. _To get Twitter Keys_ + Go to Twitter developer site [Twitter Developer](https://developer.twitter.com "Twitter Developer") and register twitter developer -> Create new project -> Create app -> Keys and token -2. *Use this template or Clone this repository and push to your Github* -https://github.com/dhohirpradana/Twitter-Automatically-Name-Banner.git +| key name | description | +| --------------------------- | ------------------------------------------------------------------------------------------ | +| TWITTER_API_KEY | The Consumer Key for your Twitter App (this is the same for every user) | +| TWITTER_API_SECRET | The Consumer Secret for your Twitter App (this is the same for every user) | +| TWITTER_ACCESS_TOKEN | The Public part of an Access Token for your Twitter App (this is different for every user) | +| TWITTER_ACCESS_TOKEN_SECRET | The Secret part of an Access Token for your Twitter App (this is different for every user) | +| NODEMAVEN_PROXY | The Secret part of an Access Token for your Twitter App (this is different for every user) | -3. *Set Github Secrets* -Go to your repository -> Settings -> Secrets -> Action -> Set TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET, TWITTER_API_KEY, TWITTER_API_SECRET with your Twitter keys +2. _Use this template or Clone this repository and push to your Github_ + https://github.com/dhohirpradana/Twitter-Automatically-Name-Banner.git -4. (*if .github/workflows/main.yml not exists)* *Create Workflow* -Go to your repository -> Actions -> New workflow -> Setup a workflow yourself -> whatever.yaml +3. _Set Github Secrets_ + Go to your repository -> Settings -> Secrets -> Action -> Set TWITTER_ACCESS_TOKEN, TWITTER_ACCESS_TOKEN_SECRET, TWITTER_API_KEY, TWITTER_API_SECRET with your Twitter keys + +4. (_if .github/workflows/main.yml not exists)_ _Create Workflow_ + Go to your repository -> Actions -> New workflow -> Setup a workflow yourself -> whatever.yaml ```javascript name: twitter auto update banner and name @@ -46,7 +48,7 @@ jobs: run: | python -m pip install --upgrade pip pip install tweepy - + - name: execute py script # run app.py env: TWITTER_API_KEY: '${{ secrets.TWITTER_API_KEY }}' diff --git a/README1.md b/README1.md new file mode 100644 index 0000000..2af10d2 --- /dev/null +++ b/README1.md @@ -0,0 +1,274 @@ +## Overview + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ApproachDescriptionDifficultySpeed
Obtain Twitter API Keys and TokensCreate a Twitter Developer account.MediumMedium
Python Programming LanguageProgramming language known for its readability and clear syntax.HardMedium
Python PipPackage installer for Python.EasyFast
TweepyPython library that provides easy access to the Twitter API.EasyFast
+ +## APPROACH 1. Obtain Twitter API keys and tokens + +### Twitter Developer + +Twitter Developer refers to the platform and resources provided by Twitter for developers to build applications, integrate Twitter data, and create new functionalities using Twitter's API (Application Programming Interface). + +### Keys and Tokens + +In the context of Twitter Developer, "Key" and "Token" usually refer to API keys and access tokens, which are essential for authentication and authorization when making requests to the Twitter API. + +- **API Key (Consumer Key):** + + - The API key, also known as the Consumer Key, is a unique identifier assigned to your application when you create a Twitter Developer account and register a new app. It is used to authenticate your application when making requests to the Twitter API. + +- **API Secret Key (Consumer Secret):** + + - The API secret key, or Consumer Secret, is a secret code that must be kept confidential. It is used along with the API key to authenticate your application. + +- **Access Token:** + + - Access tokens are generated after you've authenticated your application using the API key and secret key. These tokens represent the authorization granted to your application to access specific Twitter accounts or perform certain actions on behalf of a user. + +- **Access Token Secret:** + - The access token secret is used in conjunction with the access token to further authenticate requests made by your application. + +### How to Get? + +To obtain API keys and tokens for Twitter Developer: + +1. **Create a Twitter Developer Account:** + + - Go to the [Twitter Developer](https://developer.twitter.com/en/apps) portal. + - Sign in with your Twitter account or create a new one. + - Create a new app, providing necessary information about your application. + +2. **Generate API Key and Secret:** + + - Once your app is created, navigate to the "Keys and tokens" tab. + - You will find your API key and API secret key. + +3. **Generate Access Token and Access Token Secret:** + - Scroll down to the "Access token & access token secret" section. + - Click on the "Create" button to generate your access token and access token secret. + +## APPROACH 2. Python Programming Language + +[Python](https://www.python.org/) is a high-level, general-purpose programming language known for its readability and clear syntax. Created by Guido van Rossum and first released in 1991, Python is renowned for its modular design, support for various programming paradigms, and a rich ecosystem. + +### Key Features of Python: + +- Clean and readable syntax. +- Interpreted and cross-platform execution. +- Support for object-oriented programming (OOP) and functional programming. +- Extensive collection of modules and standard libraries. +- Automatic memory management. +- Large and active user community. + +### Installation + +To use [Python](https://www.python.org/), you need to follow these steps: + +#### 1. Install Python + +Visit the [official Python website](https://www.python.org/) and download the latest version of Python. Follow the installation instructions for your operating system. + +#### 2. Verify Installation + +After installation, open a terminal or command prompt and run the following commands to verify that Python is installed: + +```bash +python --version +``` + +**Source:** + +- [Python Official Website](https://www.python.org/) + +## APPROACH 3. Python Pip + +[Pip](https://pypi.org/project/pip/) is the package installer for Python. It is a command-line tool that allows you to install and manage Python packages from the Python Package Index (PyPI). Pip simplifies the process of installing and managing external libraries, frameworks, and tools that enhance the functionality of your Python projects. + +### Installing Pip + +Pip usually comes pre-installed with Python versions 3.4 and above. If you need to install or upgrade Pip, you can use the following command: + +```bash +python -m ensurepip --default-pip +``` + +## APPROACH 4. Tweepy + +[Tweepy](https://www.tweepy.org/) is a Python library that provides easy access to the Twitter API. It simplifies the process of interacting with Twitter data, allowing developers to retrieve tweets, post tweets, search for users, and perform various other actions on the Twitter platform. + +**How to Install Tweepy:** + +You can install Tweepy using the `pip` package manager. Open a terminal or command prompt and run the following command: + +```bash +pip install tweepy +``` + +example: + +```python +import tweepy + +# Set your Twitter API credentials +consumer_key = 'your_consumer_key' +consumer_secret = 'your_consumer_secret' +access_token = 'your_access_token' +access_token_secret = 'your_access_token_secret' + +# Authenticate with the Twitter API +auth = tweepy.OAuthHandler(consumer_key, consumer_secret) +auth.set_access_token(access_token, access_token_secret) + +# Create an API object +api = tweepy.API(auth) + +# Retrieve tweets from the user's timeline +user_tweets = api.user_timeline(screen_name='username', count=5) + +# Display the retrieved tweets +for tweet in user_tweets: + print(f"{tweet.user.screen_name}: {tweet.text}") +``` + +## Bypassing Bot Detection + +### I. IP hiding techniques + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TechniqueSpeedCostScaleAnonymityOther RisksAdditional Notes
VPN Service
⭐⭐
⭐⭐
Fast, offers a balance of anonymity and speedUsually paid- Good for small-scale operations.
- May not be suitable for high-volume scraping due to potential IP blacklisting.
- Provides good anonymity and can bypass geo-restriction.
- Potential for IP blacklisting/blocks if the VPN's IP range is known to the target site.
- Service reliability varies.
- Possible activity logs.
Choose a reputable provider to avoid security risks.
TOR Network
⭐⭐
Very slow due to onion routingFree- Fine for small-scale, impractical for time-sensitive/ high-volume scraping due to very slow speed.
- Consider only for research purposes, not scalable data collection.
- Offers excellent privacy.
- Tor exit nodes can be blocked or malicious, like potential for eavesdropping.
-Slowest choice
Public
Wi-Fi

VaryFreeFine for small-scale.Potential for being banned by target sites if scraping is detected.Potential unsecured networksLong distance way solution.
Mobile Network
⭐⭐
Relatively fast but slower speeds on some networksPaid, potential for additional costs.Using mobile IPs can be effective for small-scale scraping, impractical for large-scale.Mobile IPs can change but not an anonymous option since it's tied to your personal account.-Using own data
Private/
Dedicated Proxies

⭐⭐⭐
⭐⭐
(Best)
FastPaid- Best for large-scale operations and professional scraping projects.Offer better performance and reliability with lower risk of blacklisting.Vary in quality- Rotating Proxies are popular choices for scraping as they can offer better speed and a variety of IPs.
- You can use this proxy checker tool to assess your proxy quality
Shared Proxies
⭐⭐⭐
(Free)
⭐⭐
⭐⭐
(Paid)
Slow to ModerateUsually Free or cost-effective for low-volume scraping.Good for basic, small-scale, or non-critical scraping tasks.Can be overloaded or blacklisted or, encountering already banned IPs.Potential unreliable/ insecure proxies, especially Free ones.
+ +**IMPORTANT**: Nothing above is absolutely safe and secure. _Caution is never superfluous_. You will need to research more about them if you want to enhance the security of your data and privacy. + +### II. Private/Dedicated Proxies (Most effective IP hiding technique) + +As you can conclude from the table above, **Rotating Private/Dedicated Proxies** is the most effective IP hiding technique for **undetectable** and **large-scale** scraping. Below are 2 popular ways to effectively integrate this technique into your scraping process: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TechniqueSpeedCostScaleAnonymityAdditional Notes
Residential Rotating Proxies
⭐⭐⭐
⭐⭐
(Best)
FastPaidIdeal for high-end, large-scale scraping tasks.- Mimics real user IPs and auto-rotate IPs when using proxy gateways, making detection harder.
- Provides high anonymity and low risk of blacklisting/blocks due to legitimate residential IPs.
Consider proxy quality, location targeting, and rotation speed.
Datacenter Rotating Proxies
⭐⭐
⭐⭐
Faster than Residential ProxiesMore affordable than Residential ProxiesGood for cost-effective, large-scale scraping.Less anonymous than Residential Proxies.
- Higher risk of being blocked.
- Easily detectable due to their datacenter IP ranges.
Consider reputation of the provider and frequency of IP rotation.
+ +I created twitter automation using [NodeMaven](https://nodemaven.com/?a_aid=dhohirpradana), and so far it works well and stable. diff --git a/screenshot/nodemaven_proxy.png b/screenshot/nodemaven_proxy.png new file mode 100644 index 0000000..a2bb784 Binary files /dev/null and b/screenshot/nodemaven_proxy.png differ