RedditSticky
COMMENT
RedditSticky is created by couplelongnecks.
It creates a sticky note with a random reddit post from your favourite subreddits (👇 beneath comments).
By Default the useage is setup to work within an automation.
designed to be triggered/Refreshed at certain times, app opens etc.
When RedditSticky is run not in the automation it will open the current sticky link.
It can also be refreshed from share sheet.
COMMENT
SETUP:
Automation >When app opens(eg. Safari)>Any input>Run RedditSticky
-Requirements
•Pyto
•ToolboxPro
•bs4 module in Pyto
TEXT
"python", "programming", "hacking", "learnprogramming", "shortcuts",

Text
SCRIPTING
If
Shortcut Input
does not have any value
MISSING
Under Construction
MISSING
Under Construction
SCRIPTING
If
Global Variable Result
is
None
SCRIPTING
Show alert
Informational Message
SHORTCUTS

Shortcut Result
SCRIPTING
Otherwise
SAFARI
Open
Global Variable Result
SCRIPTING
End If

If Result
SCRIPTING
Otherwise
TEXT
import feedparser
import random
import console
from ast import literal_eval
from bs4 import BeautifulSoup
subreddits = [
Text
]
num_posts = 1
def reddit_feeds():
random_index = random.randint(0, len(subreddits)-1)
random_sub = subreddits[random_index]
feed = 'http://www.reddit.com/r/{}/.rss'.format(random_sub)
parsed = feedparser.parse(feed)
rand_ent_ind = random.randint(0, (len(parsed.entries)-1))
rand_entry = parsed.entries[rand_ent_ind]
tag = str(rand_entry.tags)
tag = tag.strip("[]")
tag = literal_eval(tag)
label = tag['label']
soupSummary = BeautifulSoup(rand_entry.summary, "html.parser")
sum = soupSummary.get_text()
summary = sum + " : " + rand_entry.link
randy = label + " : " + rand_entry.title
return randy, summary
for i in range(num_posts):
print (reddit_feeds())

Text
MISSING
Under Construction
MISSING
Under Construction
VARIABLES
Set variable
ScriptOutput
to
Output
TEXT
Match
(\W|^)\[link\]\s\[comments\]\s:(\W|$)\S*.{1,}
in
ScriptOutput

Matches
TEXT
Split
Matches
by
Custom
:

Split Text
MISSING
Under Construction
MISSING
Under Construction
SCRIPTING
Count
Characters
in
ScriptOutput

Count
TEXT
Count
/.70

Text
MISSING
Under Construction
MISSING
Under Construction
MISSING
Under Construction
MEDIA
Overlay
ScriptOutput
on
Result

Overlaid Image
MEDIA
Resize
Overlaid Image
to
1000
x
Auto Height

Resized Image
MEDIA
Resize
Result
to
1000
x
Auto Height

Resized Image
MISSING
Under Construction
MEDIA
Overlay
Resized Image
on
Blurred Images

Overlaid Image
MISSING
Under Construction
MEDIA
Overlay
Overlaid Image
on
Result

Overlaid Image
MISSING
wallpaper.set Under Construction
SCRIPTING
End If

If Result
Showcuts