Skip to content

Commit

Permalink
add github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedesmaili committed Jul 22, 2021
1 parent 59bd101 commit df8d6ac
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ on: push
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
if: >-
github.event_name != 'create' ||
github.event.ref_type == 'tag'
# if: >-
# github.event_name != 'create' ||
# github.event.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,19 +10,21 @@ pip3 install better-twitter
To be able to use this package, you need to [register a Twitter app](https://github.com/saeedesmaili/better-twitter/blob/main/docs/twitter_app.md) and add its credentials when you use this package for the first time. This package will connect to your Twitter account using that app's credentials on behalf of you.

### Get started
#### Using in command line
#### Block from file
To block multiple users of a file:
```bash
better-twitter --block-file test_file.csv
```
Note: The csv file should have two columns named `user_id` and `screen_name`.

#### Mute from file
To mute multiple users of a file:
```bash
better-twitter --mute-file test_file.csv
```
Note: The csv file should have two columns named `user_id` and `screen_name`.

#### Update Twitter API
To update twitter API credentials:
```bash
better-twitter --update-api
@@ -39,4 +41,6 @@ better-twitter --update-api
- [ ] Add "remove my tweets older than N days" functionality
- [ ] Add "remove my likes older than N days" functionality
- [ ] Add "search for tweets containing a specific word/hashtag and block/mute them"
- [ ] Add "export an account's tweets/followers/followings/likes"
- [ ] Add "export an account's tweets/followers/followings/likes"
- [ ] Add "block accounts tweeting about a specific hashtag"
- [ ] Add "export block list"
5 changes: 2 additions & 3 deletions better_twitter/main.py
Original file line number Diff line number Diff line change
@@ -91,8 +91,7 @@ def update_api():


def parse():
parser = argparse.ArgumentParser(
description="Make twitter a better place with multiple options.")
parser = argparse.ArgumentParser(description="Make twitter a better place with multiple options.")

parser.add_argument(
"--block-file",
@@ -152,7 +151,7 @@ def action_from_file(api, file_path, df_accounts, action="block"):
response = api.CreateMute(user_id=row.user_id)
status = "muted"
except twitter.error.TwitterError as e:
if e.message[0]["code"] in [34, 50]: # [Sorry; that page does not exist, User not found]
if e.message[0]["code"] in [34, 50]: # [That page does not exist, User not found]
print(f"User not found: {row['screen_name']}")
data = {
"user_id": row["user_id"],
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

setup(
name="better-twitter",
version="0.0.19",
version="0.0.20",
description="A python package to block and mute fake and toxic twitter accounts in an automated and easy way.",
long_description=long_description,
long_description_content_type="text/markdown",

0 comments on commit df8d6ac

Please sign in to comment.