Login About Gallery
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",
SCRIPTING
If
Shortcut Input
does not have any value
Under Construction
Under Construction
SCRIPTING
SCRIPTING
Show alert
Informational Message
Title
optional
Show Cancel Button
SHORTCUTS
Run
RedditSticky
Input
Text
Show While Running
Otherwise
End If
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())
Under Construction
Under Construction
VARIABLES
Set variable
ScriptOutput
to
Output
TEXT
Match
(\W|^)\[link\]\s\[comments\]\s:(\W|$)\S*.{1,}
in
ScriptOutput
Case Sensitive
TEXT
Split
Matches
by
Custom
:
Under Construction
Under Construction
SCRIPTING
Count
Characters
in
ScriptOutput
TEXT
Count
/.70
Under Construction
Under Construction
Under Construction
MEDIA
Overlay
ScriptOutput
on
Result
Show Image Editor
Position
Bottom Right
Width
100
Height
100
Opacity
65
MEDIA
Resize
Overlaid Image
to
1000
x
Auto Height
MEDIA
Resize
Result
to
1000
x
Auto Height
Under Construction
MEDIA
Show Image Editor
Position
Bottom Right
Width
100
Height
100
Opacity
100
Under Construction
MEDIA
Show Image Editor
Position
Bottom Right
Width
100
Height
100
Opacity
100
wallpaper.set Under Construction
End If

Showcuts

Magic Vars

Screenshot

Submitted Anonymously 11 days ago

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0