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
MISSING
‎ Under Construction
MISSING
‎ Under Construction
SCRIPTING
‎If ‎Global Variable Result ‎is ‎None
SCRIPTING
‎Show alert ‎Informational Message
Title
‎optional
Show Cancel Button
SHORTCUTS
‎Run ‎RedditSticky
Input
‎Text
Show While Running
SCRIPTING
‎Otherwise
SAFARI
‎Open ‎Global Variable Result
SCRIPTING
‎End If
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())
MISSING
‎ Under Construction
MISSING
‎ 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 ‎:
MISSING
‎ Under Construction
MISSING
‎ Under Construction
SCRIPTING
‎Count ‎Characters ‎in ‎ScriptOutput
TEXT
‎Count ‎/.70
MISSING
‎ Under Construction
MISSING
‎ Under Construction
MISSING
‎ 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
MISSING
‎ Under Construction
MEDIA
‎Overlay ‎Resized Image ‎on ‎Blurred Images
Show Image Editor
Position
‎Bottom Right
Width
‎100
Height
‎100
Opacity
‎100
MISSING
‎ Under Construction
MEDIA
‎Overlay ‎Overlaid Image ‎on ‎Result
Show Image Editor
Position
‎Bottom Right
Width
‎100
Height
‎100
Opacity
‎100
MISSING
‎wallpaper.set Under Construction
SCRIPTING
‎End If

Showcuts

Magic Vars

Screenshot

Submitted Anonymously 3 years ago

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0