mirror of
https://github.com/developersIndia/deviras.git
synced 2024-12-22 16:19:50 +05:30
commit
174e2a6e16
20
dataset.json
Normal file
20
dataset.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"titles": [
|
||||||
|
"ranting about jira",
|
||||||
|
"siting in a meeting",
|
||||||
|
"squashing bugs",
|
||||||
|
"centering divs",
|
||||||
|
"waiting for staging deployment",
|
||||||
|
"writing tests",
|
||||||
|
"pushing directly to prod",
|
||||||
|
"doing code review",
|
||||||
|
"deleting jira tickets",
|
||||||
|
"Creating a pull request",
|
||||||
|
"forgot to run DB migrations",
|
||||||
|
"Broke production",
|
||||||
|
"running on staging ENV",
|
||||||
|
"merging git branches",
|
||||||
|
"releasing the MVP",
|
||||||
|
"finding JIRA tickets"
|
||||||
|
]
|
||||||
|
}
|
26
main.py
26
main.py
@ -2,35 +2,20 @@ import praw
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
import json
|
||||||
titles = [
|
|
||||||
"ranting about jira",
|
|
||||||
"siting in a meeting",
|
|
||||||
"squashing bugs",
|
|
||||||
"centering divs",
|
|
||||||
"waiting for staging deployment",
|
|
||||||
"writing tests",
|
|
||||||
"pushing directly to prod",
|
|
||||||
"doing code review",
|
|
||||||
"deleting jira tickets",
|
|
||||||
"Creating a pull request",
|
|
||||||
"forgot to run DB migrations",
|
|
||||||
"Broke production",
|
|
||||||
"running on staging ENV",
|
|
||||||
"merging git branches",
|
|
||||||
"releasing the MVP",
|
|
||||||
"finding JIRA tickets"
|
|
||||||
]
|
|
||||||
|
|
||||||
client_id = os.environ["REDDIT_CLIENT_ID"]
|
client_id = os.environ["REDDIT_CLIENT_ID"]
|
||||||
client_secret = os.environ["REDDIT_CLIENT_SECRET"]
|
client_secret = os.environ["REDDIT_CLIENT_SECRET"]
|
||||||
reddit_pass = os.environ["REDDIT_PASSWORD"]
|
reddit_pass = os.environ["REDDIT_PASSWORD"]
|
||||||
|
|
||||||
def get_titles():
|
def get_titles():
|
||||||
|
with open('dataset.json', 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
|
||||||
|
titles = data['titles']
|
||||||
currentlyViewingText, subscribersText = random.sample(titles, 2)
|
currentlyViewingText, subscribersText = random.sample(titles, 2)
|
||||||
return [currentlyViewingText, subscribersText]
|
return [currentlyViewingText, subscribersText]
|
||||||
|
|
||||||
|
|
||||||
def update_titles():
|
def update_titles():
|
||||||
reddit = praw.Reddit(
|
reddit = praw.Reddit(
|
||||||
client_id=client_id,
|
client_id=client_id,
|
||||||
@ -53,4 +38,5 @@ def update_titles():
|
|||||||
widgets.refresh()
|
widgets.refresh()
|
||||||
widgets.id_card.mod.update(subscribersText=titles[1])
|
widgets.id_card.mod.update(subscribersText=titles[1])
|
||||||
|
|
||||||
|
|
||||||
update_titles()
|
update_titles()
|
Loading…
Reference in New Issue
Block a user