Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

A python script to transform a list of subreddits in the clipboard into a paste-able format to be used in an Alien Blue group. Copy the list from your multireddit, run the script in Pythonista, then create a new group in Alien Blue and paste. Thats it!

View ABMultiredditGenerator.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
import console
import clipboard
import webbrowser
 
def main():
text = clipboard.get()
noNewlines = text.replace('\n',' ')
array = noNewlines.split(' ')
ABString = finalStringFromArray(array)
clipboard.set(ABString)
webbrowser.open('alienblue://')
 
 
def finalStringFromArray(array):
removeX = shouldRemoveX(array)
finalString = ''
i = 0
for i in range(0,len(array)):
if array[i] != None:
if array[i][:3] == 'add':
break
if array[i][:3] == '/r/':
if removeX:
finalString = finalString + array[i][3:-1]
else:
finalString = finalString + array[i][3:]
finalString = finalString + "+"
finalString = finalString[:-1]
return finalString
 
def shouldRemoveX(array):
numX = 0
numReddits = 0
for i in range(0,len(array)):
if array[i] != None:
if array[i][:3] == 'add':
break
if array[i][:3] == '/r/':
numReddits +=1
if array[i][-1:] == 'x':
numX += 1
return numReddits == numX
 
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.