Get Drawn

A python script for reddit


In [1]:
x = 'hello ther!'

In [2]:
mylist = []

In [3]:
mylist.append('testing adding this to the list!')

In [4]:
mylist


Out[4]:
['testing adding this to the list!']

In [5]:
mylist.append()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-b2b2eee38e27> in <module>()
----> 1 mylist.append()

TypeError: append() takes exactly one argument (0 given)

In [6]:
import os
import random
import bs4
import requests
import re
import json

In [7]:
import praw

In [8]:
r = praw.Reddit(user_agent='redditgetsdrawn blog post')

In [9]:
rd = r.get_subreddit('redditgetsdrawn')

In [10]:
rd.url


Out[10]:
u'/r/redditgetsdrawn/'

In [11]:
rd.created


Out[11]:
1329037453.0

In [12]:
subls = []

In [13]:
subrd = rd.subscribers
subls.append(subrd)

In [14]:
subls


Out[14]:
[56685]

In [15]:
wikipg = list(rd.get_wiki_pages())[4]

In [16]:
from string import maketrans   # Required to call maketrans function.

intab = "aeiou"
outtab = "12345"
trantab = maketrans(intab, outtab)


str = "this is string example....wow!!!";
print str.translate(trantab);


th3s 3s str3ng 2x1mpl2....w4w!!!

In [17]:
wikipg.has_fetched


Out[17]:
False

In [18]:
wikipg.revision_by


Out[18]:
Redditor(user_name='ItWillBeMine')

In [19]:
#wikipg.content_html

In [20]:
savmd = open('wiki.md', 'w')

In [21]:
wikip = wikipg.content_md

In [22]:
savmd.write(wikip)

In [23]:
savmd.close()

In [24]:
allmods = list(rd.get_moderators())

In [25]:
allmods.sort()

In [26]:
modzro = allmods[3]

In [27]:
modcom = modzro.get_comments()

In [28]:
banlolz = []

In [29]:
for infz in modcom:
    print infz
    banlolz.append(infz)


Pardon me, what part of

&gt;Please note that this thread is not the place to...
That's a good point! Approved by a technicality (and because it's beautiful)....
Your comment was stuck in the spam filter for 17 hours. :( It's free now!
Gift posts aren't allowed, so your post was removed.
Please repost without the first sentence of your title.
Just because I don't like your tone.
OP, you have artists to thank.
No need to critique the art that someone has worked on for you for free. Thanks.
Welcome to the sub! :)
You have artists to thank.
Your comment was removed because placeholder comments aren't allowed. Please ...
Welcome back!
OP, you have artists to thank.
Yep.
Remember that all art submitted has to contain a likeness of OP. :(
Welcome to the sub! :)
I love to find those! :D
Did you draw/paint on top of the image?
Yay, I love when freehanders say freehand! :D
&lt;gasp&gt;
Too late. :)
Because artist preference doesn't trump sub rules, and we don't think anyone ...
Your comment was removed. Please read the rules of the sub before participati...
Beginners are welcome, as long as you're giving it a serious attempt - beginn...
Thank you and welcome!

In [30]:
len(banlolz)

banlizt = []

In [31]:
for banz in banlolz:
    print banz
    banlizt.append((banz.body))


Pardon me, what part of

&gt;Please note that this thread is not the place to...
That's a good point! Approved by a technicality (and because it's beautiful)....
Your comment was stuck in the spam filter for 17 hours. :( It's free now!
Gift posts aren't allowed, so your post was removed.
Please repost without the first sentence of your title.
Just because I don't like your tone.
OP, you have artists to thank.
No need to critique the art that someone has worked on for you for free. Thanks.
Welcome to the sub! :)
You have artists to thank.
Your comment was removed because placeholder comments aren't allowed. Please ...
Welcome back!
OP, you have artists to thank.
Yep.
Remember that all art submitted has to contain a likeness of OP. :(
Welcome to the sub! :)
I love to find those! :D
Did you draw/paint on top of the image?
Yay, I love when freehanders say freehand! :D
&lt;gasp&gt;
Too late. :)
Because artist preference doesn't trump sub rules, and we don't think anyone ...
Your comment was removed. Please read the rules of the sub before participati...
Beginners are welcome, as long as you're giving it a serious attempt - beginn...
Thank you and welcome!

In [32]:
blsz = []

In [33]:
banlizt
for bez in banlizt:
    
    print bez
    #if  'remove' or 'banned' in bez: 
     #   blsz.append(bez)


Pardon me, what part of

&gt;Please note that this thread is not the place to bring up questions about mod decisions (our rules discuss this). It derails the thread. Thanks.

was unclear?
That's a good point! Approved by a technicality (and because it's beautiful). :) I'm just giving a gentle and loving reminder for future reference! &lt;hands you plate of virtual brownies&gt;
Your comment was stuck in the spam filter for 17 hours. :( It's free now!
Gift posts aren't allowed, so your post was removed.
Please repost without the first sentence of your title.
Just because I don't like your tone.
OP, you have artists to thank.
No need to critique the art that someone has worked on for you for free. Thanks.
Welcome to the sub! :)
You have artists to thank.
Your comment was removed because placeholder comments aren't allowed. Please just make a new comment when your art is ready. Thanks!
Welcome back!
OP, you have artists to thank.
Yep.
Remember that all art submitted has to contain a likeness of OP. :(
Welcome to the sub! :)
I love to find those! :D
Did you draw/paint on top of the image?
Yay, I love when freehanders say freehand! :D
&lt;gasp&gt;
Too late. :)
Because artist preference doesn't trump sub rules, and we don't think anyone should be creating t-shirts, mugs, etc. unless the artist gets paid. As this is a free sub, it's a no go.

Please note that this thread is not the place to bring up questions about mod decisions (our rules discuss this). It derails the thread. Thanks.
Your comment was removed. Please read the rules of the sub before participating, and don't ask for personal information such as location.
Beginners are welcome, as long as you're giving it a serious attempt - beginners can learn a lot here!
Thank you and welcome!

In [34]:
blsz


Out[34]:
[]

In [1493]:
izone = banlizt[0]

In [35]:
szone = str(izone())


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-35-9b76133fc8e3> in <module>()
----> 1 szone = str(izone())

NameError: name 'izone' is not defined

In [1492]:
str = banlizt;
print str.translate(trantab);


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1492-9f9d97c3619f> in <module>()
      1 str = banlizt;
----> 2 print str.translate(trantab);

AttributeError: 'list' object has no attribute 'translate'

In [1074]:
modzro.fullname


Out[1074]:
u't2_6l4z3'

In [1075]:
print infz.subreddit


AskReddit

In [1076]:
print infz.body


Hi there! It looks like you may not have posted a **direct question**, and only the question in your title. Please repost and include **only the question** in your title, and add any context in the text box. 

If you want to answer your own question, make sure to do that **as a comment reply**. 

If you feel you received this message in error, please contact the mods, thanks!


In [1077]:
rd.get_rising


Out[1077]:
<bound method Subreddit._sorted of Subreddit(display_name='redditgetsdrawn')>

In [1078]:
rd.get_top_from_year


Out[1078]:
<bound method Subreddit._sorted of Subreddit(display_name='redditgetsdrawn')>

In [1079]:
rd.get_stylesheet()


Out[1079]:
{u'images': [{u'link': u'url(%%Banner%%)',
   u'name': u'Banner',
   u'url': u'http://a.thumbs.redditmedia.com/NU4gPaPs7zgbDA3l.png'},
  {u'link': u'url(%%RGDtext%%)',
   u'name': u'RGDtext',
   u'url': u'http://f.thumbs.redditmedia.com/F8zFK7R0vqyDRfw_.png'},
  {u'link': u'url(%%Background%%)',
   u'name': u'Background',
   u'url': u'http://c.thumbs.redditmedia.com/wLrYssI2q9h7rVNP.png'}],
 u'stylesheet': u'/****************************************************************************\n BEGIN: banner and header menus\n ****************************************************************************/\n#header {\n overflow: visible !important;\n background-image:url(%%Banner%%);\n background-repeat: repeat-x;\n height:130px;\n margin-top:20px;\n border-bottom:2px solid black;\n}\n\n#header-img.default-header {\n display:none !important;\n}\n\n#sr-header-area{\n position:absolute;\n top:-20px;\n border-bottom:2px solid black !important;    /* default: 1px solid gray */\n width:100%;\n height:20px;\n}\n\n#header-bottom-right{\n background-color:#FFFFFF;                    /* default: #EFF7FF */\n padding:2px 5px 0px 5px !important;          /* default: 4px 4px 7px */\n border-radius:0px !important;                /* default: 0 0 0 3px */\n top:133px !important;                        /* default: 19px */\n width:auto;\n text-align:right;\n z-index:9;\n}\n\n#header-bottom-right #mail{\n text-align:left;\n}\n\n#header-bottom-right #modmail{\n text-align:left;\n}\n\n#userbarToggle{\n min-height: 20px !important;                 /* default: 24px */\n height:20px !important;                      /* default 100% */\n line-height:17px !important;                 /* default: 24px */\n}\n\n#header-bottom-left{\n position:absolute;\n top:132px;\n}\n\n#header-bottom-left #header-img-a{\n display:none !important;\n}\n\n#header-bottom-left .pagename a{\n background:url(%%RGDtext%%);\n background-repeat:no-repeat;\n float:left;\n width:187px;\n height:20px;\n margin-top:2px;\n text-indent:-9999px;\n}\n\n.tabmenu{\n float:left;\n}\n\n.tabmenu a[href$="/controversial/"] {\n display:none;\n}\n\n.side{\n margin-top:22px;\n border-top: 1px solid #5F99CF;\n}\n\n\n.titlebox .redditname a{\n background:url(%%RGDtext%%);\n background-repeat:no-repeat;\n float:left;\n width:187px !important;\n height:20px !important;\n text-indent:-9999px;\n}\n\n.content{\n padding-top:7px;\n margin-top:22px;\n border-top: 1px solid #5F99CF;\n}\n/****************************************************************************\n END: banner and header menus\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: body watermark\n ****************************************************************************/\nbody {\n background: url(%%Background%%) no-repeat fixed center center;\n}\n/****************************************************************************\n END: body watermark\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: message before submission page\n ****************************************************************************/\n.formtabs-content{\n border-top:0px;\n}\n\n#newlink .infobar {\n display:none !important;\n}\n\n#title-field:before{\n display: block;\n background-color: yellow;\n content: " Do not contact the mods if you do not see your submission in the new queue. All posts land in the spam filter until reviewed and approved. If your submission is not approved, a mod will explain the reason(s) why. Be sure to review the rules before participating.  ";\n font-weight:bold;\n font-size:14px;\n padding:2px;\n margin-top: 5px;\n margin-bottom: 5px;\n border:1px solid yellow;\n border-radius: 5px;\n}\n\n#text-field:before{\n display: block;\n background-color: yellow;\n content: "Your text should NOT contain names.  Your photo should be hosted on IMGUR only.";\n font-weight:bold;\n font-size:14px;\n padding:2px;\n margin-top: 5px;\n margin-bottom: 5px;\n border:1px solid yellow;\n border-radius: 5px;\n}\n\n#url-field:before{\n display: block;\n background-color: yellow;\n content: " In your title, please state your relations with the person in the photo. See below for further submission rules.";\n font-weight:bold;\n font-size:14px;\n padding:2px;\n margin-top: 5px;\n margin-bottom: 5px;\n border:1px solid yellow;\n border-radius: 5px;\n}\n\n.info-notice:after{\n display: block;\n background-color: yellow;\n content: "Please wait at least three days between submissions.";\n font-weight:bold;\n font-size:14px;\n padding:2px;\n margin-top: 5px;\n border:1px solid yellow;\n border-radius: 5px;\n}\ndiv.submit_text.roundfield.enabled h1:after{\n    display: block;\n    background-color: yellow;\n    content: "Read the rules below before submitting your image! ";\n    font-weight:bold;\n    font-size:14px;\n}\ndiv.submit_text.roundfield.enabled h1 {\n    text-transform: uppercase;\n    background-color: yellow;\n}\n\n/****************************************************************************\n END: message before submission page\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: Model Roulette button\n ****************************************************************************/\n.side .md a[href="http://www.reddit.com/r/redditgetsdrawn/random"] {\n display: block;\n border: 3px solid #666;\n border-radius: 3px;\n padding: 3px 5px;\n font-size: 15px;\n text-align: center;\n}\n\n.side .md a[href="http://www.reddit.com/r/redditgetsdrawn/random"]:hover {\n background: #e6e6e6;\n}\n/****************************************************************************\n END: Model Roulette button\n ****************************************************************************/\n/**************************************************************************** \nBEGIN: Custom online users text \n*****************************************************************************/\n.titlebox .word {\n display: none\n }\n.titlebox .number:after {\n content: " Subscribers";\n }\n.titlebox .users-online span.number:after {\n content: " Artists and art-lovers here now";\n }\n\n/**************************************************************************** \nBEGIN: Custom online users text \n*****************************************************************************/\n\n\n/****************************************************************************\n BEGIN: disable downvote arrows\n ****************************************************************************/\ndiv.link div.arrow.down { \n visibility: hidden;\n display: none;\n}\n\ndiv.comment div.arrow.down { \n visibility: hidden;\n display: none;\n}\n/****************************************************************************\n END: disable downvote arrows\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: rules note beneath comment entry\n ****************************************************************************/\n.commentarea {\n position: static;\n}\n\n.commentarea .usertext .usertext-edit:after {\n content: "Note: RedditGetsDrawn is strictly moderated.  Please read the rules on the wiki before participating.";\n display: block;\n text-align: left;\n margin-top: -5px;\n padding: 4px;\n background-color: #def;\n border: 1px solid #59c;\n font-size: 11px;\n font-weight: bold;\n}\n/****************************************************************************\n END: rules note beneath comment entry\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: wash out deleted messages (Void)\n ****************************************************************************\nform.grayed, form.grayed ~ ul.flat-list.buttons {\n display: none;\n}\np.tagline &gt; a.expand:first-child + em:after, div.collapsed &gt; a.expand:first-child + em:after {\n visibility: visible;\n font-size: x-small;\n font-weight: bold;\n content: "[deleted]";\n}\np.tagline &gt; a.expand:first-child + em, div.collapsed &gt; a.expand:first-child + em {\n visibility: hidden;\n font-size: 0;\n}\ndiv.collapsed &gt; a.expand:first-child + em + time + a.expand, div.collapsed &gt; a.expand:first-child + em + a.expand {\n display: none;\n}\n****************************************************************************\n END: wash out deleted messages\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: hide RES keyboard shortcut annotations\n ****************************************************************************/\n.keyNavAnnotation{\n display:none;\n}\n/****************************************************************************\n END: hide RES keyboard shortcut annotations\n ****************************************************************************/\n\n/****************************************************************************\n BEGIN: Make deleted comments less noticeable (Stolen from science)\n*****************************************************************************/\n  .deleted .grayed \n{\ndisplay: none;\n}\n/****************************************************************************\n END: Make deleted comments less noticeable (Stolen from science)\n*****************************************************************************/',
 u'subreddit_id': u't5_2tjl7'}

In [1080]:
seclis = list(rd.get_comments())

In [1081]:
newcoms = []

In [1082]:
for comes in seclis:
    print (comes)
    newcoms.append(comes)


[Here you go.](http://i.imgur.com/oul0wAk.jpg)

I traced his outline, colored...
To be honest, I think this is pretty close to how I imagine other people see ...
Well if you get it can you send it my way? That was a badass drawing
Thank you :3 I don't even like kids, but i have nothing against drawing them,...
If i wasn't lazy i could spend at least one hour on it, and it would look bet...
I love this style.

The chicken has a "...what? You have a problem, bitch?" a...
wow that looks amazing!
http://imgur.com/kmcKYKY
http://imgur.com/aFIcwB9
Oh man! Thank you. This is AMAZING!! You drew it so quickly and so well. Than...
Oh. I see. Thank you for clearing that up for me. I greatly appreciate it. 
Hey Iguman, [this sub has voted](http://www.reddit.com/r/redditgetsdrawn/comm...
Thank you!
You're welcome!
[:)] (http://i.imgur.com/mr0afly.gif)
I'm also asking them for the opportunity to buy either a print or the high-re...
From /u/Dstroyrofwrlds

http://i.imgur.com/a2kCAb2.jpg
[Imgur](http://i.imgur.com/1670Lfw.jpg)
That's great! Thanks so much!
This is the third time you've attempted to use this photo. You were told prev...
Photo submissions may only be that of yourself, a relative, SO, close friend ...
Sorry, art given here is for personal use only. Please review the sub rules b...
I love it
Thanks!  Great job!
This is great!  Thanks a ton!

In [1083]:
senrgd = []

In [1084]:
for comz in newcoms:
    print comz
    senrgd.append(comz.submission.url)


[Here you go.](http://i.imgur.com/oul0wAk.jpg)

I traced his outline, colored...
To be honest, I think this is pretty close to how I imagine other people see ...
Well if you get it can you send it my way? That was a badass drawing
Thank you :3 I don't even like kids, but i have nothing against drawing them,...
If i wasn't lazy i could spend at least one hour on it, and it would look bet...
I love this style.

The chicken has a "...what? You have a problem, bitch?" a...
wow that looks amazing!
http://imgur.com/kmcKYKY
http://imgur.com/aFIcwB9
Oh man! Thank you. This is AMAZING!! You drew it so quickly and so well. Than...
Oh. I see. Thank you for clearing that up for me. I greatly appreciate it. 
Hey Iguman, [this sub has voted](http://www.reddit.com/r/redditgetsdrawn/comm...
Thank you!
You're welcome!
[:)] (http://i.imgur.com/mr0afly.gif)
I'm also asking them for the opportunity to buy either a print or the high-re...
From /u/Dstroyrofwrlds

http://i.imgur.com/a2kCAb2.jpg
[Imgur](http://i.imgur.com/1670Lfw.jpg)
That's great! Thanks so much!
This is the third time you've attempted to use this photo. You were told prev...
Photo submissions may only be that of yourself, a relative, SO, close friend ...
Sorry, art given here is for personal use only. Please review the sub rules b...
I love it
Thanks!  Great job!
This is great!  Thanks a ton!

In [1085]:
import pyimgur

In [1086]:
pyimgur.Imgur.upload_image


Out[1086]:
<unbound method Imgur.upload_image>

In [1087]:
comz.submission.url


Out[1087]:
u'http://imgur.com/bdwp2Tn'

In [1088]:
allcom = r.get_subreddit('redditgetsdrawn')

In [1367]:
lisbox = senrgd[1]

In [1368]:
import bs4

In [1369]:
soup = bs4.BeautifulSoup(lisbox)


/usr/local/lib/python2.7/dist-packages/bs4/__init__.py:189: UserWarning: "http://i.imgur.com/3nv296w.png" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client to get the document behind the URL, and feed that document to Beautiful Soup.
  '"%s" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client to get the document behind the URL, and feed that document to Beautiful Soup.' % markup)

In [1091]:
soup.contents


Out[1091]:
[u"[here's my try!](http://i.imgur.com/h0biVZd.jpg)"]

In [1092]:
soup.index


Out[1092]:
<bound method BeautifulSoup.index of [here's my try!](http://i.imgur.com/h0biVZd.jpg)>

In [1093]:
print soup.name
print soup.contents


[document]
[u"[here's my try!](http://i.imgur.com/h0biVZd.jpg)"]

In [1379]:
myString = str(soup.string)

rdgimg = re.search("(?P<url>https?://[^\s]+)", myString).group("url")

In [1095]:
from IPython.display import Image

In [1112]:
print rdgimg


http://i.imgur.com/h0biVZd.jpg)

In [1101]:
os.chdir('/home/wcmckee/rgd')

In [1102]:
import requests

In [1103]:
reqrgd = requests.get(rdgimg)

In [1104]:
#reqrgd.text

In [1105]:
finz = (comus + '.jpg')

In [1106]:
savrgd = open(finz, 'wb')

In [1107]:
savrgd.write(reqrgd.url)
savrgd.close()

In [1110]:
finz


Out[1110]:
'lairlu.jpg'

In [1108]:
import urllib
resource = urllib.urlopen(rdgimg)
output = open(finz,"wb")
output.write(resource.read())
output.close()

In [1109]:
ls


Flchick.jpg  TheSuperAwesomeKAT.jpg  jarwastudios.jpg  style.css
IT4EtjR.jpg  file01.jpg              lairlu.jpg

In [849]:
dizusr = Image(filename=finz)

In [ ]:


In [850]:
dizusr


Out[850]:

In [1415]:
#r.login('snatchrgd', 'camp123')
r.login('artcontrol', 'test123')

In [1416]:
r.client_id

In [1417]:
redfront = r.get_front_page()

In [1418]:
for red in redfront:
    print red


982 :: Success has a small request
799 :: Favorite Batman?
1949 :: A very bright light can damage your sight, and very loud sounds can d...
369 :: Apple pie cookies I made for my brother's bake sale!
1468 :: i got a killcam while absorbing a dragon soul, the result was awesome.
705 :: When Swiss engineering meets Russian ammo: A SIG 553 in 7.62x39.
407 :: Valve Funds Glassy Mesa Development For Better Driver Performance
146 :: The $50 lesson
141 :: I finally finished my Toon Link project (x-post from /r/crossstitch)
234 :: Incoming Storm [gif]
51 :: Minimalistic still life - graphite
67 :: Went on vacation to Florida. Did a quick watercolor at Daytona Beach.
84 :: Shostakovich plays tennis
147 :: Finally Democracy 3, my political strategy game is released on the ipa...
159 :: Ash-Can with extended mag and joint holders
63 :: Pictures from yesterday's hammock hang out! Feel free to come by today ...
95 :: FPS Game Devs, Here is a muzzle flash pack for you.
33 :: Hershey's Sues Pot Candy Maker For Trademark Infringement
152 :: The card caried by a card-carring member of the Ku Klux Klan (1928)
25 :: US Workers In The Prime 25-54 Age Group Are Still 2.6 Million Short Of ...
8 :: Any fans of Bee and Puppycat? Just a silly, fun painting!
19 :: When people speak of the bekensteim bound, what exactly do they mean by...
15 :: Light Bound Update: New Underwater Level and updated UI!
23 :: Anyone else surprised by this? A simple while loop + string.replace(str...
19 :: My Horizon Walker

In [1419]:
red


Out[1419]:
<praw.objects.Submission at 0x7fb4cc808ad0>

In [1420]:
red.comments


Out[1420]:
[<praw.objects.Comment at 0x2ece3d0>]

In [1421]:
red.downs


Out[1421]:
4

In [1422]:
red.title


Out[1422]:
u'My Horizon Walker'

In [1423]:
mymod = r.get_my_moderation()

In [1424]:
for mo in mymod:
    print mo


GreenCross
artcontroldrawsyou
ArtctrlPortraits
BroBeur
artcontrol
lifemodelart
artctrl

In [1513]:
rdrawn = r.get_subreddit('redditgetsdrawn')

In [1514]:
rdrawn.subscribe()


---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
<ipython-input-1514-aaf2f5eae840> in <module>()
----> 1 rdrawn.subscribe()

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(self, *args, **kwargs)
     56             return function(self.reddit_session, *args, **kwargs)
     57         else:
---> 58             return function(self.reddit_session, self, *args, **kwargs)
     59     # Only grab the short-line doc and add a link to the complete doc
     60     wrapped.__doc__ = wrapped.__doc__.split('\n', 1)[0]

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(cls, *args, **kwargs)
    321                 raise errors.LoginRequired(function.__name__)
    322             try:
--> 323                 return function(cls, *args, **kwargs)
    324             finally:
    325                 obj._use_oauth = False  # pylint: disable-msg=W0212

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in subscribe(self, subreddit, unsubscribe)
   2104         data = {'action': 'unsub' if unsubscribe else 'sub',
   2105                 'sr_name': six.text_type(subreddit)}
-> 2106         response = self.request_json(self.config['subscribe'], data=data)
   2107         self.evict(self.config['my_subreddits'])
   2108         return response

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(reddit_session, *args, **kwargs)
    159     @wraps(function)
    160     def wrapped(reddit_session, *args, **kwargs):
--> 161         return_value = function(reddit_session, *args, **kwargs)
    162         if isinstance(return_value, dict):
    163             if return_value.get('error') == 304:  # Not modified exception

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in request_json(self, url, params, data, as_objects, retry_on_error)
    507         url += '.json'
    508         if retry_on_error is None:
--> 509             response = self._request(url, params, data)
    510         else:
    511             response = self._request(url, params, data,

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in _request(self, url, params, data, files, auth, timeout, raw_response, retry_on_error)
    372             try:
    373                 response = handle_redirect()
--> 374                 _raise_response_exceptions(response)
    375                 self.http.cookies.update(response.cookies)
    376                 if raw_response:

/usr/local/lib/python2.7/dist-packages/praw/internal.pyc in _raise_response_exceptions(response)
    171         else:
    172             raise OAuthException(msg, response.url)
--> 173     response.raise_for_status()
    174 
    175 

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in raise_for_status(self)
    771 
    772         if http_error_msg:
--> 773             raise HTTPError(http_error_msg, response=self)
    774 
    775     def close(self):

HTTPError: 403 Client Error: Forbidden

In [1515]:
rdnew = rdrawn.get_new

In [1516]:
rdrawn.submit('test', rdgimg)


---------------------------------------------------------------------------
APIException                              Traceback (most recent call last)
<ipython-input-1516-29657f392a3a> in <module>()
----> 1 rdrawn.submit('test', rdgimg)

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(self, *args, **kwargs)
     56             return function(self.reddit_session, *args, **kwargs)
     57         else:
---> 58             return function(self.reddit_session, self, *args, **kwargs)
     59     # Only grab the short-line doc and add a link to the complete doc
     60     wrapped.__doc__ = wrapped.__doc__.split('\n', 1)[0]

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(cls, *args, **kwargs)
    321                 raise errors.LoginRequired(function.__name__)
    322             try:
--> 323                 return function(cls, *args, **kwargs)
    324             finally:
    325                 obj._use_oauth = False  # pylint: disable-msg=W0212

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(obj, *args, **kwargs)
    223                 if captcha_id:
    224                     kwargs['captcha'] = get_captcha(reddit_session, captcha_id)
--> 225                 return function(obj, *args, **kwargs)
    226             except errors.InvalidCaptcha as exception:
    227                 if raise_captcha_exception or \

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in submit(self, subreddit, title, text, url, captcha, save, send_replies)
   2064             data['sendreplies'] = send_replies
   2065         result = self.request_json(self.config['submit'], data=data,
-> 2066                                    retry_on_error=False)
   2067         url = result['data']['url']
   2068         # Clear the OAUth setting when attempting to fetch the submission

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(reddit_session, *args, **kwargs)
    175                                                   return_value))
    176                 if len(error_list) == 1:
--> 177                     raise error_list[0]
    178                 else:
    179                     raise errors.ExceptionList(error_list)

APIException: (SUBREDDIT_NOTALLOWED) `you aren't allowed to post there.` on field `sr`

In [1430]:
redls = []

In [1431]:
for rd in rdnew():
    print rd
    redls.append(rd)

In [1432]:
rd.selftext


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1432-b1353e809286> in <module>()
----> 1 rd.selftext

/usr/local/lib/python2.7/dist-packages/praw/objects.pyc in __getattr__(self, attr)
     83             return getattr(self, attr)
     84         raise AttributeError('\'%s\' has no attribute \'%s\'' % (type(self),
---> 85                                                                  attr))
     86 
     87     def __ne__(self, other):

AttributeError: '<class 'praw.objects.Subreddit'>' has no attribute 'selftext'

In [1433]:
rdurlz = []
rdusers = []

In [1434]:
for itez in redls:
    print itez.url
    rdurlz.append(itez.url)
    rdusers.append(itez.author)

In [1435]:
uzrlaz = []

In [1436]:
rgdict = {'user': 'wcmckee', 'img': 'test'}
linkdict = {'links': 'artcontrol', 'user': 'url'}

In [1437]:
for rduzr in rdusers, :
    print rduzr
    uzrlaz.append(str(rduzr))
    rgdict.update({str(rduzr): 'url'})


[]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1437-3671bab66e5c> in <module>()
      1 for rduzr in rdusers, :
      2     print rduzr
----> 3     uzrlaz.append(str(rduzr))
      4     rgdict.update({str(rduzr): 'url'})
      5 

TypeError: 'str' object is not callable

In [1438]:
for itez in redls:
    print itez.url
    linkdict.update({str(itez.author):itez.url})

In [1439]:
linkdict


Out[1439]:
{'links': 'artcontrol', 'user': 'url'}

In [1440]:
rgdict


Out[1440]:
{'img': 'test', 'user': 'wcmckee'}

In [1441]:
for rez in uzrlaz:
    rgdict.update({'user': rez})

In [1442]:
rgdict


Out[1442]:
{'img': 'test', 'user': 'wcmckee'}

In [1443]:
rgdict.update({'id': rez})

In [1444]:
rgdict


Out[1444]:
{'id': 'brenafide', 'img': 'test', 'user': 'wcmckee'}

In [1445]:
uzrlaz


Out[1445]:
[]

In [1446]:
rd.downs
rd.ups


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1446-639ab5eb49e5> in <module>()
----> 1 rd.downs
      2 rd.ups

/usr/local/lib/python2.7/dist-packages/praw/objects.pyc in __getattr__(self, attr)
     83             return getattr(self, attr)
     84         raise AttributeError('\'%s\' has no attribute \'%s\'' % (type(self),
---> 85                                                                  attr))
     86 
     87     def __ne__(self, other):

AttributeError: '<class 'praw.objects.Subreddit'>' has no attribute 'downs'

In [1536]:
nezlis = []

In [1537]:
#rdurlz

for jpgz in rdurlz:
    if  '.jpg' in jpgz:
        nezlis.append(jpgz)
    #else print 'didnt append'
        

#if  '*.jpg' in rdurlz:
#    print '*.jpg'

In [1538]:
nezlis


Out[1538]:
[]

In [1530]:
import random

In [1531]:
lrdz = len(rdurlz)

In [1532]:
recrand = random.randint(0, lrdz)

In [1533]:
recrand


Out[1533]:
0

In [1534]:
freimg = nezlis[recrand]


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1534-1e2f07ff06ae> in <module>()
----> 1 freimg = nezlis[recrand]

IndexError: list index out of range

In [1535]:
strfre = str(freimg)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1535-b59f505c3ec5> in <module>()
----> 1 strfre = str(freimg)

TypeError: 'list' object is not callable

In [1535]:


In [1529]:
Image(strfre)


Out[1529]:

In [1188]:
resource = urllib.urlopen(rdgimg)
output = open(fulzname,"w")
output.write(rdgimg)
output.close()

In [ ]:
import o

In [1215]:
fulzname


Out[1215]:
'iwasfresh.jpg'

In [1216]:
rdurlz


Out[1216]:
'/r/redditgetsdrawn/'

In [1217]:
savreq = requests.get(rdurlz[7])


---------------------------------------------------------------------------
MissingSchema                             Traceback (most recent call last)
<ipython-input-1217-e7df74acdb33> in <module>()
----> 1 savreq = requests.get(rdurlz[7])

/usr/local/lib/python2.7/dist-packages/requests/api.pyc in get(url, **kwargs)
     53 
     54     kwargs.setdefault('allow_redirects', True)
---> 55     return request('get', url, **kwargs)
     56 
     57 

/usr/local/lib/python2.7/dist-packages/requests/api.pyc in request(method, url, **kwargs)
     42 
     43     session = sessions.Session()
---> 44     return session.request(method=method, url=url, **kwargs)
     45 
     46 

/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert)
    347             hooks = hooks,
    348         )
--> 349         prep = self.prepare_request(req)
    350 
    351         proxies = proxies or {}

/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in prepare_request(self, request)
    285             auth=merge_setting(auth, self.auth),
    286             cookies=merged_cookies,
--> 287             hooks=merge_hooks(request.hooks, self.hooks),
    288         )
    289         return p

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in prepare(self, method, url, headers, files, data, params, auth, cookies, hooks)
    285 
    286         self.prepare_method(method)
--> 287         self.prepare_url(url, params)
    288         self.prepare_headers(headers)
    289         self.prepare_cookies(cookies)

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in prepare_url(self, url, params)
    336         if not scheme:
    337             raise MissingSchema("Invalid URL {0!r}: No schema supplied. "
--> 338                                 "Perhaps you meant http://{0}?".format(url))
    339 
    340         if not host:

MissingSchema: Invalid URL u'i': No schema supplied. Perhaps you meant http://i?

In [1218]:
rezlz =  redls[0]

In [1219]:
reuzrz = rezlz.author

In [1220]:
usrzname = str(reuzrz.name)

In [1221]:
fulzname = (usrzname + '.jpg')

In [1222]:
resource = urllib.urlopen(rdgimg)
output = open(fulzname,"w")
output.write(rdgimg)
output.close()

In [1223]:
fulzname


Out[1223]:
'iwasfresh.jpg'

In [1224]:
Image(fulzname)


Out[1224]:

In [1225]:
ls


Flchick.jpg  TheSuperAwesomeKAT.jpg  iwasfresh.jpg     lairlu.jpg
IT4EtjR.jpg  file01.jpg              jarwastudios.jpg  style.css

In [1199]:
rgdtit = rd.title

In [1226]:
rdurlz = str(rd.url)

In [1227]:
rdauth =rd.author


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1227-d331bacbe49a> in <module>()
----> 1 rdauth =rd.author

/usr/local/lib/python2.7/dist-packages/praw/objects.pyc in __getattr__(self, attr)
     83             return getattr(self, attr)
     84         raise AttributeError('\'%s\' has no attribute \'%s\'' % (type(self),
---> 85                                                                  attr))
     86 
     87     def __ne__(self, other):

AttributeError: '<class 'praw.objects.Subreddit'>' has no attribute 'author'

In [1228]:
rdusern = str(rdauth.name)

In [1229]:
rdauth.is_gold


Out[1229]:
False

In [1230]:
rdauth.json_dict

In [1231]:
rdauth.id


Out[1231]:
u'85fjm'

In [1232]:
rdsub = rdauth.get_submitted

In [1233]:
for rsu in rdsub():
    print rsu


7 :: Could someone please draw my beautiful parents?
8 :: Exactly how much coffee grounds should I put in the filter?
6 :: Me and my roommate, looking for a rad portrait to hang in the living roo...
115 :: popping a hole in your beer before you shotgun it
9 :: Halloween a couple years ago led us to discovering Harvey, the drunk pir...
0 :: Anybody know where I can get some cheap funny knee high socks online?
8 :: This picture sums up my birthday pretty well.
43 :: What if bands made trades like sports teams do?
67 :: went to a cubs game...it wasn't even 5pm yet.
0 :: The Mona Lisa is one of the oldest, if not the oldest meme.
25 :: There was a strange point in time back in '08 or so when I didn't know ...
2 :: The water pressure in my piss stream is greater than the water pressure ...
1 :: The default picture to my college's "Secret Admirers" facebook page.
7 :: Halloween edit my friends made.
33 :: Thee Oh Sees- Stinking Cloud
5 :: My parents are in Nashville for the preds/kings game. Hearing the nation...
25 :: My friend's cat is also a scarf.
31 :: Saw this at the corner of Cortland and Albany
44 :: The winning edit from my hometown's crew battles. We worked really hard...
1 :: An edit my buddy made at Chaz Ortiz's skatepark
0 :: Secret Handshake
8 :: Kevin Westgarth getting absolutely destroyed by John Scott
3 :: Wallie tucknee
10 :: My friend has a cool cat.
3 :: Ideal date

In [1234]:
rsu.selftext


Out[1234]:
u''

In [1235]:
othasub = rsu.subreddit

In [1236]:
print othasub


pics

In [1362]:
artget = r.get_subreddit('artcontroldrawsyou')

In [1363]:
artget.submit(rdusern, rdurlz )


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1363-06108427cfa3> in <module>()
----> 1 artget.submit(rdusern, rdurlz )

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(self, *args, **kwargs)
     56             return function(self.reddit_session, *args, **kwargs)
     57         else:
---> 58             return function(self.reddit_session, self, *args, **kwargs)
     59     # Only grab the short-line doc and add a link to the complete doc
     60     wrapped.__doc__ = wrapped.__doc__.split('\n', 1)[0]

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(cls, *args, **kwargs)
    321                 raise errors.LoginRequired(function.__name__)
    322             try:
--> 323                 return function(cls, *args, **kwargs)
    324             finally:
    325                 obj._use_oauth = False  # pylint: disable-msg=W0212

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(obj, *args, **kwargs)
    223                 if captcha_id:
    224                     kwargs['captcha'] = get_captcha(reddit_session, captcha_id)
--> 225                 return function(obj, *args, **kwargs)
    226             except errors.InvalidCaptcha as exception:
    227                 if raise_captcha_exception or \

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in submit(self, subreddit, title, text, url, captcha, save, send_replies)
   2064             data['sendreplies'] = send_replies
   2065         result = self.request_json(self.config['submit'], data=data,
-> 2066                                    retry_on_error=False)
   2067         url = result['data']['url']
   2068         # Clear the OAUth setting when attempting to fetch the submission

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(reddit_session, *args, **kwargs)
    159     @wraps(function)
    160     def wrapped(reddit_session, *args, **kwargs):
--> 161         return_value = function(reddit_session, *args, **kwargs)
    162         if isinstance(return_value, dict):
    163             if return_value.get('error') == 304:  # Not modified exception

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in request_json(self, url, params, data, as_objects, retry_on_error)
    510         else:
    511             response = self._request(url, params, data,
--> 512                                      retry_on_error=retry_on_error)
    513         hook = self._json_reddit_objecter if as_objects else None
    514         # Request url just needs to be available for the objecter to use

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in _request(self, url, params, data, files, auth, timeout, raw_response, retry_on_error)
    371         while True:
    372             try:
--> 373                 response = handle_redirect()
    374                 _raise_response_exceptions(response)
    375                 self.http.cookies.update(response.cookies)

/usr/local/lib/python2.7/dist-packages/praw/__init__.pyc in handle_redirect()
    344                 response = self.handler.request(request=request.prepare(),
    345                                                 proxies=self.http.proxies,
--> 346                                                 timeout=timeout, **kwargs)
    347                 url = _raise_redirect_exceptions(response)
    348             return response

/usr/local/lib/python2.7/dist-packages/praw/handlers.pyc in wrapped(cls, _cache_key, _cache_ignore, _cache_timeout, **kwargs)
    124             with cls.ca_lock:
    125                 clear_timeouts()
--> 126                 if _cache_key in cls.cache:
    127                     if cls.cache_hit_callback:
    128                         cls.cache_hit_callback(_cache_key)

TypeError: unhashable type: 'list'

In [1239]:
artctrl = r.get_redditor('artcontrol')

In [1240]:
arlik = artctrl.get_liked

In [1241]:
arlik


Out[1241]:
<bound method Redditor.get_liked of Redditor(user_name='artcontrol')>

In [1242]:
print arlik


<bound method Redditor.get_liked of Redditor(user_name='artcontrol')>

In [1243]:
print arlik()


<generator object get_content at 0x7fb4cc24ab90>

In [1413]:
ls


Flchick.jpg  TheSuperAwesomeKAT.jpg  iwasfresh.jpg     lairlu.jpg  wiki.md
IT4EtjR.jpg  file01.jpg              jarwastudios.jpg  style.css

In [1409]:
drzu = r.get_subreddit('artcontroldrawsyou')

In [1410]:
drzu


Out[1410]:
Subreddit(display_name='artcontroldrawsyou')

In [1414]:
drzu.upload_image()


---------------------------------------------------------------------------
LoginOrScopeRequired                      Traceback (most recent call last)
<ipython-input-1414-2376010eaf9a> in <module>()
----> 1 drzu.upload_image()

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(self, *args, **kwargs)
     56             return function(self.reddit_session, *args, **kwargs)
     57         else:
---> 58             return function(self.reddit_session, self, *args, **kwargs)
     59     # Only grab the short-line doc and add a link to the complete doc
     60     wrapped.__doc__ = wrapped.__doc__.split('\n', 1)[0]

/usr/local/lib/python2.7/dist-packages/praw/decorators.pyc in wrapped(cls, *args, **kwargs)
    318             elif login:
    319                 if scope:
--> 320                     raise errors.LoginOrScopeRequired(function.__name__, scope)
    321                 raise errors.LoginRequired(function.__name__)
    322             try:

LoginOrScopeRequired: ``upload_image` requires a logged in session or the OAuth2 scope `modconfig`` requires a logged in session

In [ ]: