mirror of
https://github.com/trevorhobenshield/twitter-api-client.git
synced 2025-12-19 18:12:11 -05:00
added examples
This commit is contained in:
BIN
assets/account.gif
Normal file
BIN
assets/account.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
BIN
assets/scrape.gif
Normal file
BIN
assets/scrape.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 MiB |
BIN
assets/search.gif
Normal file
BIN
assets/search.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 872 KiB |
12
info/util.py
Normal file
12
info/util.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def compress(file: Path):
|
||||||
|
print(f'processing: {file}')
|
||||||
|
subprocess.call(
|
||||||
|
f'ffmpeg -i {file} -c:v libx265 -vtag hvc1 -c:a copy {file.stem}_min{file.suffix}',
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
shell=True,
|
||||||
|
)
|
||||||
@@ -10,6 +10,8 @@ pip install twitter-api-client
|
|||||||
|
|
||||||
### Automation
|
### Automation
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
```python
|
```python
|
||||||
from twitter.account import Account
|
from twitter.account import Account
|
||||||
|
|
||||||
@@ -149,6 +151,8 @@ account.update_search_settings({
|
|||||||
|
|
||||||
#### Get all user/tweet data
|
#### Get all user/tweet data
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
```python
|
```python
|
||||||
from twitter.scraper import Scraper
|
from twitter.scraper import Scraper
|
||||||
|
|
||||||
@@ -175,6 +179,8 @@ scraper.download_media([456, 567, 678])
|
|||||||
|
|
||||||
#### Search
|
#### Search
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
```python
|
```python
|
||||||
from twitter.search import search
|
from twitter.search import search
|
||||||
|
|
||||||
@@ -189,8 +195,6 @@ search(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- search results are output to `~/data/raw`
|
- search results are output to `~/data/raw`
|
||||||
- ~400 search results rate limiting occurs
|
- ~400 search results rate limiting occurs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user