{ "metadata": { "name": "", "signature": "sha256:08ed8b2bffb208cb9f9aa0e0c1e2703bbfbf549d2f66b6d59bb1a4700d0f9f32" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "# Transfer local to ftp\n", "\n", "import pysftp\n", "sftpconn = pysftp.Connection('STFP SITE HERE', \n", " username='INSERT HERE', password='INSERT HERE')\n", "sftpconn.put('C:/api/sked/sched.json', 'sked/sched.json')\n", "sftpconn.put('C:/api/sked/thedict.json', 'sked/thedict.json')\n", "sftpconn.put('C:/api/sked/errlog.txt', 'sked/errlog.txt')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 23, "text": [ "" ] } ], "prompt_number": 23 }, { "cell_type": "code", "collapsed": false, "input": [ "# Transfer ftp to local\n", "\n", "import pysftp\n", "\n", "sftpconn = pysftp.Connection('STFP SITE HERE', \n", " username='INSERT HERE', password='INSERT HERE')\n", "sftpconn.get('sked/sched.json', 'C:/api/sked/sched.json')\n", "sftpconn.get('sked/thedict.json', 'C:/api/sked/thedict.json')\n", "sftpconn.get('sked/errlog.txt', 'C:/api/sked/errlog.txt')" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "def delete_globs():\n", " import json\n", " import os\n", " del_dict = json.loads( open('C:/api/sked/thedict.json', 'r').read() )\n", " del_list = del_dict['glob_to_delete']\n", " for pos in range(len(del_list)):\n", " try:\n", " os.remove(str(del_list[pos]))\n", " print del_list[pos]\n", " del_list[pos] = 'xxx'\n", " print del_list\n", " except:\n", " pass\n", " del_list = [x for x in del_list if x != 'xxx']\n", " del_dict['glob_to_delete'] = del_list\n", " with open('C:/api/sked/thedict.json', 'w+') as f:\n", " f.write(json.dumps(del_dict))\n", " import pysftp\n", " sftpconn = pysftp.Connection('STFP SITE HERE', \n", " username='INSERT HERE', password='INSERT HERE')\n", " sftpconn.put('C:/api/sked/thedict.json', 'sked/thedict.json')" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "import requests\n", "import json\n", "import urllib\n", "import os\n", "import glob\n", "import tumblpy\n", "import shutil\n", "import re\n", "import pysftp\n", "import pyimgur\n", "import cStringIO\n", "from PIL import Image\n", "import webbrowser\n", "from IPython.display import display\n", "from IPython.display import Image as imaged\n", "import win32clipboard\n", "\n", "def addToClipBoard(text):\n", " win32clipboard.OpenClipboard()\n", " win32clipboard.EmptyClipboard()\n", " win32clipboard.SetClipboardText(text)\n", " win32clipboard.CloseClipboard()\n", "\n", "class Sharer(object):\n", " def __init__(self):\n", " self.site_url = ''\n", " self.img_irl = ''\n", " self.title = ''\n", " self.comment = ''\n", " self.platform = '' #########################\n", " self.folder = ''\n", " #for tumblr\n", " self.tum = tumblpy.Tumblpy('TOKEN',\n", " 'TOKEN',\n", " 'TOKEN',\n", " 'TOKEN')\n", " self.tumblogs = {'pr':'http://INSERT HERE.tumblr.com/',\n", " 'cc':'http://INSERT HERE.tumblr.com/',\n", " 'pv':'http://INSERT HERE.tumblr.com/',\n", " 'vs':'http://INSERT HERE.tumblr.com/'}\n", " self.tumresp = ''\n", " self.tumblog = ''\n", " self.tumbltags = ''\n", " \n", " #for sftp\n", " self.sftpconn = pysftp.Connection('STFP SITE HERE', \n", " username='INSERT HERE', password='INSERT HERE')\n", " self.sftpconn.get('sked/sched.json', 'C:/api/sked/sched.json')\n", " self.sftpconn.get('sked/thedict.json', 'C:/api/sked/thedict.json')\n", " self.sftpconn.get('sked/errlog.txt', 'C:/api/sked/errlog.txt')\n", " \n", " delete_globs()\n", " \n", " def show_constants(self):\n", " print 'image irl = ', self.img_irl\n", " print 'title = ', self.title\n", " print 'comment = ', self.comment\n", " \n", " def change(self, what, to=''):\n", " if what=='img_irl':\n", " self.img_irl=to\n", " elif what=='title': \n", " self.title=to\n", " elif what=='comment':\n", " self.comment=to\n", " else: print 'invalid change'\n", " \n", " def tumblit(self, tblog = '', tumcomment='', tags='', state='queue', removal=True):\n", " \"\"\" state=queue (default) or published. Caption can have html \"\"\"\n", " if tblog == '':\n", " if self.tumblog == '':\n", " self.tumblog = raw_input(\"Tumblr (pr, cc, pv, vs): \")\n", " else:\n", " self.tumblog = tblog\n", " if tags != '':\n", " self.tumbltags = tags\n", " if self.platform == 'glob':\n", " choice = 'f'\n", " else:\n", " choice='u'\n", " if choice == \"f\":\n", " photo = open(self.img_irl, 'rb')\n", " if self.tumblog=='cc':\n", " self.tumresp = self.tum.post('post', blog_url=self.tumblogs[self.tumblog], \n", " params={'type':'photo',\n", " 'state':state,\n", " 'caption': tumcomment,\n", " 'tags':self.tumbltags,\n", " 'data': photo})\n", " else:\n", " self.tumresp = self.tum.post('post', blog_url=self.tumblogs[self.tumblog], \n", " params={'type':'photo',\n", " 'state':state, 'tweet':'off',\n", " 'caption': tumcomment,\n", " 'tags':self.tumbltags,\n", " 'data': photo})\n", " elif choice == \"u\":\n", " if self.tumblog=='cc':\n", " self.tumresp = self.tum.post('post', blog_url=self.tumblogs[self.tumblog], \n", " params={'type':'photo',\n", " 'state':state,\n", " 'caption': tumcomment,\n", " 'tags':self.tumbltags,\n", " 'source': self.img_irl})\n", " else:\n", " self.tumresp = self.tum.post('post', blog_url=self.tumblogs[self.tumblog], \n", " params={'type':'photo',\n", " 'state':state, 'tweet':'off', \n", " 'caption': tumcomment,\n", " 'tags':self.tumbltags,\n", " 'source': self.img_irl})\n", " print \"Tumblr response:\", self.tumresp # returns id if posted successfully\n", " if removal == True:\n", " self.getridofit()\n", " \n", " def redditit(self, title='', sub=[''], comment='', when='', removal=True, overrideurl=''):\n", " subreddits = [\"gifs\", \"comicbooks\", \"pics\", \"dataisbeautiful\", \n", " \"montreal\", \"funny\", \"Art\", \"gifs\", \"woahdude\", \n", " \"FullMovieGifs\", \"HistoryPorn\", \"MapPorn\",\n", " \"canada\"]\n", " \n", " sched = json.loads( open('C:/api/sked/sched.json', 'r').read() )\n", " thedict = json.loads( open('C:/api/sked/sched.json', 'r').read() )\n", " \n", " tocontinue = False\n", " tocontinue2 = True\n", " print sub,\n", " for subr in sub:\n", " print subr,\n", " if subr in subreddits:\n", " print \"!\"\n", " tocontinue = True\n", " if tocontinue == False:\n", " continuestr = raw_input('subreddit not in list. Continue? Y/n: ')\n", " if continuestr in ['Y', 'y']:\n", " tocontinue = True\n", " if tocontinue == True and overrideurl == '':\n", " resolution = ''\n", " if self.platform == 'glob':\n", " im = pyimgur.Imgur('TOKEN', 'TOKEN') \n", " theupload = im.upload_image(path=self.img_irl)\n", " url = theupload.link\n", " pilimg=Image.open(self.img_irl)\n", " resolution = ' [' + str(pilimg.size[0]) + 'x' + str(pilimg.size[1]) + ']'\n", " else:\n", " im = pyimgur.Imgur('TOKEN', 'TOKEN') \n", " theupload = im.upload_image(url=self.img_irl)\n", " url = theupload.link\n", " if sub[-4:] == 'Porn':\n", " if resolution == '':\n", " pilfile = cStringIO.StringIO(urllib.urlopen('http://1.bp.blogspot.com/-RF8eKDAe6TQ/U9vivlxnmHI/AAAAAAAAAwE/lSmBjDLa3R4/s1600/CMQ6Zgm.jpg').read())\n", " pilimg = Image.open(pilfile)\n", " resolution = ' [' + str(pilimg.size[0]) + 'x' + str(pilimg.size[1]) + ']'\n", " title += resolution\n", " \n", " #check karma decay\n", " imgur_suffix = url[7:]\n", " kd_url = \"http://www.karmadecay.com/\" + imgur_suffix\n", " import urllib2\n", " kd_req = urllib2.Request(kd_url, headers={'User-Agent' : \"Magic Browser\"})\n", " kd_conn = urllib2.urlopen( kd_req )\n", " kd_html = kd_conn.read()\n", " kd_found = kd_html.find(\"No very similar images were found.\")\n", " if kd_found == -1:\n", " webbrowser.open(kd_url)\n", " continuestr = raw_input('Karma Decay found image. Continue? Y/n: ')\n", " if continuestr not in ['Y', 'y']:\n", " tocontinue2 = False\n", " \n", " if tocontinue == True and tocontinue2 == True:\n", " td = {}\n", " if overrideurl != '':\n", " td['url'] = overrideurl\n", " else:\n", " td['url'] = url\n", " td['title'] = title\n", " td['comment']=comment\n", " td['when']=when\n", " td['sub']=sub\n", " sched.append(td)\n", " with open('C:/api/sked/sched.json', 'w+') as f: # write json to list of dicts\n", " f.write(json.dumps(sched))\n", " self.sftpconn.put('C:/api/sked/sched.json', 'sked/sched.json')\n", " if removal == True:\n", " self.getridofit() \n", " \n", " def downloadit(self, fb=False):\n", " filename = raw_input(\"Enter filename, or enter to use irl name:\")\n", " thepath = 'C:/api/'\n", " if fb ==True:\n", " thefolder = 'fb'\n", " else:\n", " thefolder = raw_input(\"Folder name, enter for root, any single char for same as last time\")\n", " \n", " if len(thefolder) == 1:\n", " thefolder = self.folder\n", " print 'Saving to ' + thepath + thefolder\n", " if len(thefolder) > 0:\n", " thepath = thepath + thefolder\n", " self.folder = thefolder \n", " if not os.path.isdir(thepath): # creates path if it does not exist\n", " os.makedirs(thepath)\n", " \n", " if filename == \"\":\n", " filename = self.img_irl.rsplit('\\\\', 1)[-1]\n", " filename = filename.rsplit('/', 1)[-1]\n", " else:\n", " filename = filename + self.img_irl[-4:]\n", " print filename\n", " print thepath\n", " print thefolder\n", " thepath = thepath + '/' + filename\n", " print thepath\n", " if self.platform == 'glob':\n", " print self.img_irl, thepath\n", " os.rename(self.img_irl, thepath)\n", " else:\n", " urllib.urlretrieve(self.img_irl, thepath)\n", " self.nextit()\n", "\n", " def googlit(self):\n", " toclip = self.img_irl\n", " if self.platform == 'glob':\n", " toclip = toclip.rsplit('\\\\', 1)[-1]\n", " toclip = toclip.rsplit('/', 1)[-1]\n", " addToClipBoard(toclip)\n", " webbrowser.open('https://images.google.com/')\n", "\n", "\n", " def __str__(self):\n", " return self.showconstants()\n", "\n", "class Pocket(Sharer):\n", " def __init__(self):\n", " Sharer.__init__(self)\n", " self.request = requests.post(\"https://getpocket.com/v3/get\",\n", " params={'consumer_key':'TOKEN',\n", " 'access_token':'TOKEN',\n", " 'state':'unread', 'sort':'newest',\n", " 'detailType':'complete'})\n", " assert self.request.status_code == 200\n", " self.json = json.loads(self.request.text)['list']\n", " self.entry_ids = list(self.json.keys())\n", " self.entry_ids_n = len(self.entry_ids)\n", " self.entry_pos = 0\n", " self.init_entry()\n", " self.platform = 'pocket'\n", " \n", " def init_entry(self):\n", " self.entry_c = self.json[self.entry_ids[self.entry_pos]]\n", " self.entry_c_imgs = []\n", " dimens = []\n", " if 'images' in self.entry_c.keys():\n", " for key in self.entry_c['images'].keys():\n", " self.entry_c_imgs.append(key)\n", " dimens.append((int(self.entry_c['images'][key]['width'])+1) * (int(self.entry_c['images'][key]['height'])+1))\n", " self.entry_c_img_pos = dimens.index(max(dimens))\n", " self.entry_c_img_n = len(self.entry_c_imgs)\n", " self.title = self.entry_c['resolved_title']\n", " self.site_url = self.entry_c['resolved_url']\n", " if len(self.entry_c_imgs) > 0:\n", " self.img_irl = self.entry_c['images'][self.entry_c_imgs[self.entry_c_img_pos]]['src']\n", " self.showit()\n", " \n", " def showit(self):\n", " print \"Post {} of {}\".format(self.entry_pos + 1, self.entry_ids_n)\n", " print \"[ %s ]\" % (self.entry_c['resolved_title'])\n", " self.show_constants()\n", " if len(self.entry_c_imgs) == 0:\n", " print \"No images.\"\n", " else: \n", " print \"Image: {} of {}: {}\".format(self.entry_c_img_pos + 1, self.entry_c_img_n, \n", " self.entry_c['images'][self.entry_c_imgs[self.entry_c_img_pos]]['src'])\n", " display(imaged(url=self.entry_c['images'][self.entry_c_imgs[self.entry_c_img_pos]]['src']))\n", " if len(self.entry_c_imgs) > 1:\n", " print \"Other images:\"\n", " for pos in range(self.entry_c_img_n):\n", " if pos != self.entry_c_img_pos:\n", " print self.entry_c['images'][self.entry_c_imgs[pos]]['src']\n", " display(imaged(url=self.entry_c['images'][self.entry_c_imgs[pos]]['src']))\n", " else:\n", " print self.entry_c['images'][self.entry_c_imgs[pos]]['src']\n", " print \"[CURRENT IMAGE]\"\n", " \n", " def next_image(self):\n", " if len(self.entry_c_imgs) > 1:\n", " self.entry_c_img_pos = (self.entry_c_img_pos + 1) % self.entry_c_img_n\n", " self.showit()\n", " \n", " def previous_image(self):\n", " if len(self.entry_c_imgs) > 1:\n", " self.entry_c_img_pos = (self.entry_c_img_pos - 1) % self.entry_c_img_n\n", " self.showit()\n", " \n", " def nextit(self):\n", " self.entry_pos = (self.entry_pos + 1) % self.entry_ids_n\n", " self.init_entry()\n", " \n", " def previt(self):\n", " self.entry_pos = (elf.sentry_pos - 1) % self.entry_ids_n\n", " self.init_entry()\n", "\n", " def getridofit(self):\n", " to_archive = self.entry_ids[self.entry_pos]\n", " arch_json_text = \"[{\\\"action\\\":\\\"archive\\\",\\\"item_id\\\":\" + to_archive + \"}]\"\n", " arch_request = requests.post(\"https://getpocket.com/v3/send\",\n", " params={'consumer_key':'TOKEN',\n", " 'access_token':'TOKEN',\n", " 'actions':arch_json_text})\n", " assert arch_request.status_code == 200\n", " self.nextit()\n", "\n", "class Globit(Sharer):\n", " def __init__(self):\n", " Sharer.__init__(self)\n", " self.pos_c = 0\n", " self.globlist = glob.glob(\"C:/api/*.jpg\") + glob.glob(\"C:/api/*.png\") + glob.glob(\"C:/api/*.gif\")\n", " self.glob_n = len(self.globlist)\n", " self.glob_pos = 0\n", " self.showit()\n", " self.platform = 'glob'\n", " \n", " def showit(self):\n", " self.img_irl = self.globlist[self.glob_pos]\n", " print self.glob_pos, \"of\", self.glob_n\n", " print self.globlist[self.glob_pos]\n", " self.show_constants()\n", " if self.globlist[self.glob_pos][:-4] == '.gif':\n", " print '### opening in external applicatipn ###'\n", " external() \n", " nextit()\n", " else:\n", " try:\n", " display(imaged(self.globlist[self.glob_pos]))\n", " except:\n", " print '\\n##############################\\nDisplay error\\n##############################'\n", " \n", " def external(self):\n", " os.system(\"start \\\"\"+self.img_irl+\"\\\"\")\n", " \n", " def rename(self):\n", " newname = raw_input(\"Enter new name: \")\n", " newname += self.globlist[self.glob_pos][-4:]\n", " os.rename(self.globlist[self.glob_pos], newname)\n", " self.nextit()\n", " self.showit()\n", " \n", " def getridofit(self):\n", " os.close(os.open(self.img_irl, os.O_RDONLY))\n", " del_dict = json.loads( open('C:/api/sked/thedict.json', 'r').read() )\n", " del_list = del_dict['glob_to_delete']\n", " del_list.append(self.img_irl) \n", " del_dict['glob_to_delete'] = del_list\n", " with open('C:/api/sked/thedict.json', 'w+') as f:\n", " f.write(json.dumps(del_dict))\n", " import pysftp\n", " sftpconn = pysftp.Connection('STFP SITE HERE', \n", " username='INSERT HERE', password='INSERT HERE')\n", " sftpconn.put('C:/api/sked/thedict.json', 'sked/thedict.json') \n", " delete_globs()\n", " self.nextit()\n", " \n", " def nextit(self):\n", " self.glob_pos = (self.glob_pos + 1) % self.glob_n\n", " self.showit()\n", " \n", " def previt(self):\n", " self.glob_pos = (self.glob_pos - 1) % self.glob_n\n", " self.showit()\n", "\n", "class Tumblit(Sharer):\n", " def __init__(self):\n", " Sharer.__init__(self)\n", " self.tumlikes = self.tum.post('user/likes')['liked_posts']\n", " self.n_entries = len(self.tumlikes)\n", " self.entry_pos = 0\n", " self.theid = ''\n", " self.reblog = ''\n", " self.platform = 'tumblr'\n", " self.init_entry()\n", " \n", " def init_entry(self):\n", " self.entry_c = self.tumlikes[self.entry_pos]\n", " self.entry_c_imgs = self.entry_c['photos']\n", " self.entry_c_imgs_n = len(self.entry_c_imgs)\n", " self.entry_c_imgs_pos = 0\n", " if 2>1:\n", " self.title = self.entry_c['caption']\n", " self.title = re.sub('<.?>', '', self.title)\n", " self.theid = self.entry_c['id']\n", " self.reblog = self.entry_c['reblog_key']\n", " if len(self.entry_c_imgs) > 0:\n", " self.img_irl = self.entry_c_imgs[self.entry_c_imgs_pos]['original_size']['url'] \n", " else:\n", " self.img_irl = ''\n", " self.showit()\n", " \n", " def showit(self):\n", " print \"Post {} of {}\".format(self.entry_pos + 1, self.n_entries)\n", " self.show_constants()\n", " self.show_images()\n", " \n", " def show_images(self):\n", " if len(self.entry_c_imgs) == 0:\n", " print \"No images.\"\n", " else: \n", " print \"Image: {} of {}: {}\".format(self.entry_c_imgs_pos + 1, self.entry_c_imgs_n, \n", " self.entry_c_imgs[self.entry_c_imgs_pos]['original_size']['url'])\n", " display(imaged(url=self.entry_c_imgs[self.entry_c_imgs_pos]['original_size']['url']))\n", " if 2>1:\n", " print \"Other images:\"\n", " for pos in range(self.entry_c_imgs_n):\n", " if pos != self.entry_c_imgs_pos:\n", " print self.entry_c_imgs[pos]['original_size']['url']\n", " todisp = display(imaged(url=self.entry_c_imgs[pos]['original_size']['url']))\n", " else:\n", " print self.entry_c_imgs[pos]['original_size']['url']\n", " print \"[CURRENT IMAGE]\"\n", " \n", " \n", " def next_image(self):\n", " if self.entry_c_imgs_n > 1:\n", " self.entry_c_imgs_pos = (self.entry_c_imgs_pos + 1) % self.entry_c_imgs_n\n", " self.show_images()\n", " \n", " def previous_image(self):\n", " if self.entry_c_imgs_n > 1:\n", " self.entry_c_imgs_pos = (self.entry_c_imgs_pos - 1) % self.entry_c_imgs_n\n", " self.show_images()\n", " \n", " def nextit(self):\n", " self.entry_pos = (self.entry_pos + 1) % self.n_entries\n", " self.init_entry()\n", " \n", " def previt(self):\n", " self.entry_pos = (elf.sentry_pos - 1) % self.n_entries\n", " self.init_entry() \n", " \n", " def getridofit(self):\n", " self.tum.post('user/unlike', params={'id': self.theid, 'reblog_key': self.reblog})\n", " self.nextit()" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "# from PIL import Image\n", "# from IPython.display import display\n", "# from IPython.display import Image as imaged\n", "# display(imaged(url='http://i.imgur.com/ffuK7Ec.jpg'))\n", "# ignore = Image.open('C:/sample.jpg')\n", "# print \"works.\"" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "thetags = ''\n", "def x(cmd):\n", " \"\"\"0 for help\"\"\"\n", " global thetags\n", " if cmd == 0:\n", " print '1 previous'\n", " print '2 next w/o removal'\n", " print '3 next and remove'\n", " print '11 previous image'\n", " print '22 next image'\n", " print '4 download or move with removal'\n", " print '44 download w/o removal'\n", " print '444 facebook it'\n", " print '55 globit external'\n", " print '56 globit rename'\n", " print '6 googlit'\n", " print '81-84 tumblit and remove pr cc pv vs'\n", " print '818-848 tumblit wo removal'\n", " print '9 redditit and remove'\n", " print '99 redditit wo removal'\n", " print '999 manual reddit'\n", " z.showit()\n", " if cmd == 1:\n", " z.previt()\n", " if cmd == 2:\n", " z.nextit()\n", " if cmd == 3:\n", " z.getridofit()\n", " if cmd == 11:\n", " if z.platform != 'glob':\n", " z.previous_image()\n", " else:\n", " print \"Invalid command for glob.\"\n", " if cmd == 22:\n", " if z.platform != 'glob':\n", " z.next_image()\n", " else:\n", " print \"Invalid command for glob.\"\n", " if cmd == 4:\n", " z.downloadit()\n", " if cmd == 44:\n", " z.downloadit()\n", " z.getridofit()\n", " if cmd == 444:\n", " z.downloadit(fb=True)\n", " if z.platform != 'glob':\n", " print 'Not deleted (I think). Use command 3.'\n", " else:\n", " z.nextit()\n", " if cmd == 55:\n", " if z.platform == 'glob':\n", " z.external()\n", " else:\n", " print \"Invalid command for glob.\"\n", " if cmd == 56:\n", " if z.platform == 'glob':\n", " z.rename()\n", " else:\n", " print \"Invalid command for glob.\"\n", " if cmd == 6:\n", " z.googlit()\n", " if 80 < cmd < 89 or 810 < cmd < 858:\n", " clipb = \"z.tumblit(tblog = '\"\n", " thetags = ''\n", " if cmd == 81 or cmd == 818:\n", " clipb+='pr'\n", " elif cmd == 82 or cmd == 828:\n", " clipb+='cc'\n", " thetags = 'comics, comic books, funny, lol'\n", " elif cmd == 83 or cmd == 838:\n", " clipb+='pv'\n", " thetags = 'posters, vintage'\n", " elif cmd == 84 or cmd == 848:\n", " clipb+='vs'\n", " thetags = 'vintage, swimming pool'\n", " clipb += \"', \\n tumcomment=\\\"\"\n", " clipb += z.title\n", " clipb += \"\\\", \\n tags='\" + thetags\n", " clipb += \"', \\n \"\n", " if 810 < cmd < 858:\n", " clipb += \"removal=False, \\n \"\n", " clipb += \"state='queue')\"\n", " addToClipBoard(clipb)\n", " print \"Command in clipboard.\"\n", "\n", " if cmd == 9 or cmd == 99 or cmd == 999:\n", " clipb = \"z.redditit(title='\"\n", " if cmd != 999:\n", " clipb += z.title\n", " clipb += \"', \\n sub=[''], \\n comment='', \\n when='whenever'\"\n", " if cmd == 99:\n", " clipb += \", removal=True\"\n", " if cmd == 999:\n", " clipb += \", overrideurl=''\"\n", " clipb += \")\"\n", " addToClipBoard(clipb)\n", " print \"Command in clipboard.\"\n", "\n", " " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 } ], "metadata": {} } ] }