diff options
| author | steve <steve@haxors.club> | 2024-07-06 16:16:14 +0100 |
|---|---|---|
| committer | steve <steve@haxors.club> | 2024-07-06 16:16:14 +0100 |
| commit | 84090ca8bc10853db10000940b72604a0d7c293a (patch) | |
| tree | 4da8717c69f6e2420d748a6b2dd4430494a0fc50 /minreddit.py | |
| download | barkingspider-84090ca8bc10853db10000940b72604a0d7c293a.tar.gz barkingspider-84090ca8bc10853db10000940b72604a0d7c293a.tar.bz2 barkingspider-84090ca8bc10853db10000940b72604a0d7c293a.zip | |
Initial release
Diffstat (limited to 'minreddit.py')
| -rw-r--r-- | minreddit.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/minreddit.py b/minreddit.py new file mode 100644 index 0000000..73ddd41 --- /dev/null +++ b/minreddit.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import sys, getopt +import requests + +def extract_reddit(tag): + base_url = f"https://www.reddit.com/r/{sub}.json" + r = requests.get(base_url, headers = {'User-agent': 'yourbot'}) + data = r.json()['data']['children'] + + for i in data: + d = i['data'] + title, url, score = d['title'], d['url'], d['score'] + + print(f"\"{title}\" - {url} ({score})") + +sub = "blueteamsec" +extract_reddit(sub) |
