Skip to content

Commit 60854c2

Browse files
authored
Update README.md
1 parent 3ebaadd commit 60854c2

File tree

1 file changed

+55
-5
lines changed

1 file changed

+55
-5
lines changed

README.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GitHub Bot
22

3-
GitHub Bot is an automation tool designed to interact with GitHub's API. It allows you to automatically star repositories and follow users based on specific criteria. This tool ensures compliance with GitHub's Terms of Service by pacing its operations to avoid being flagged as spam.
3+
GitHub Bot is a powerful automation tool designed to interact with GitHub's API. It allows you to automatically star repositories and follow users based on specific criteria, ensuring compliance with GitHub's Terms of Service. With features like rate limit awareness, undo operations, and graceful shutdown, GitHub Bot is your ideal companion for managing GitHub activity efficiently and safely.
44

55
## Features
66

@@ -27,10 +27,40 @@ GitHub Bot is an automation tool designed to interact with GitHub's API. It allo
2727
```
2828

2929
2. **Set Up Environment**:
30-
Ensure you have Java 11 or higher installed. Set the `GITHUB_TOKEN` environment variable with your GitHub Personal Access Token.
31-
```sh
32-
export GITHUB_TOKEN=your_github_token
33-
```
30+
Ensure you have Java 11 or higher installed.
31+
32+
### Setting Up GitHub Token
33+
34+
1. **Obtain a Personal Access Token**:
35+
- Go to [GitHub's Personal Access Token Settings](https://github.com/settings/tokens).
36+
- Click on "Generate new token (classic)".
37+
- Give your token a descriptive name.
38+
- Set an expiration for your token as per your preference.
39+
40+
2. **Set Required Permissions**:
41+
- Under `Select scopes`, select the following permissions:
42+
- `repo` (Full control of private repositories)
43+
- `public_repo` (Access public repositories)
44+
- `user` (Read and write user profile data)
45+
- Click "Generate token".
46+
47+
3. **Copy the Token**:
48+
- Copy the generated token. You won't be able to see it again once you navigate away from the page.
49+
50+
4. **Set Up Environment Variable**:
51+
- **Windows**:
52+
- Open the Start Search, type in "env", and select "Edit the system environment variables".
53+
- Click the "Environment Variables…" button.
54+
- In the "System variables" section, click "New…".
55+
- Set `Variable name` to `GITHUB_TOKEN` and `Variable value` to your copied token.
56+
- Click OK and apply the changes.
57+
- **macOS/Linux**:
58+
- Open a terminal window.
59+
- Run the following command to set the environment variable:
60+
```sh
61+
export GITHUB_TOKEN=your_github_token
62+
```
63+
- To make this change permanent, add the above line to your shell's startup file (e.g., `~/.bashrc`, `~/.zshrc`).
3464
3565
### Compiling in an IDE
3666
@@ -100,6 +130,26 @@ GitHub Bot is an automation tool designed to interact with GitHub's API. It allo
100130
java -jar github-bot.jar
101131
```
102132
133+
## Changing the Query/Search Criteria
134+
135+
If you want to change the query or search criteria, you need to modify the code in the `Utils.java` file. Here is how you can do it:
136+
137+
1. **Open `Utils.java`**:
138+
- Locate the `fetchAllRepositories` method in the `Utils.java` file.
139+
140+
2. **Modify the Query**:
141+
- Find the line where the query is set:
142+
```java
143+
String query = URLEncoder.encode(String.format("created:>%s stars:<4", yesterday), StandardCharsets.UTF_8);
144+
```
145+
- Change the query string to your desired criteria. For example, if you want to search for repositories with more than 10 stars, you can modify it as follows:
146+
```java
147+
String query = URLEncoder.encode(String.format("created:>%s stars:>10", yesterday), StandardCharsets.UTF_8);
148+
```
149+
150+
3. **Build and Run**:
151+
- After modifying the query, rebuild the project and run it again using the instructions provided in the [Usage](#usage) section.
152+
103153
## Detailed Explanation
104154
105155
### Rate Limit Check

0 commit comments

Comments
 (0)