ArtControl.me Python Development


In [1]:
import requests
import json

In [4]:
webArt = ('http://artcontrol.me/?wpapi=search&dev=1&keyword=post&count=2&page=1&content=1')

In [7]:
dawArt = requests.get(webArt)

In [8]:
jawArt = json.loads(dawArt.text)
print jawArt


{u'status': u'ok', u'count': u'2', u'count_total': 10, u'posts': [{u'status': u'publish', u'category': [{u'term_group': 0, u'count': 84, u'name': u'Digital Painting', u'parent': 0, u'term_id': 169, u'cat_ID': 169, u'category_description': u'', u'category_parent': 0, u'object_id': 6152, u'filter': u'raw', u'category_count': 84, u'term_taxonomy_id': 181, u'cat_name': u'Digital Painting', u'taxonomy': u'category', u'category_nicename': u'digpaint', u'slug': u'digpaint', u'description': u''}, {u'term_group': 0, u'count': 33, u'name': u'RedditGetsDrawn', u'parent': 169, u'term_id': 170, u'cat_ID': 170, u'category_description': u'', u'category_parent': 169, u'object_id': 6152, u'filter': u'raw', u'category_count': 33, u'term_taxonomy_id': 182, u'cat_name': u'RedditGetsDrawn', u'taxonomy': u'category', u'category_nicename': u'redditgetsdrawn-digpaint', u'slug': u'redditgetsdrawn-digpaint', u'description': u''}], u'name': u'lana-gestdrawn', u'parent': u'0', u'title': u'lana getsdrawn', u'url': u'http://artcontrol.me/?p=6152', u'author': [{u'first_name': u'Will', u'last_name': u'mckee', u'name': u'Will', u'nicename': u'wmckee', u'url': u'', u'slug': u'wmckee', u'gravatar': u'http://www.gravatar.com/avatar/5e2931ce807064cea9fc263f5346ad86?s=100&d=mm&r=g', u'id': u'1', u'description': u''}], u'excerpt': u"Happy New Year.\r\nHere's the first post of 2015.\r\nA series of GetsDrawn digital painting works. Three layers - line, grayscale, colour.\r\n\r\n\r\n\r\n&nbsp;\r\n\r\nLine. Square spiky", u'modified': u'2015-01-02 20:24:22', u'slug': u'lana getsdrawn', u'content': u'Happy New Year.\r\nHere\'s the first post of 2015.\r\nA series of GetsDrawn digital painting works. Three layers - line, grayscale, colour.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-line.png"><img class="aligncenter size-large wp-image-6158" src="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-line-1024x724.png" alt="kieraJo-line" width="788" height="557" /></a>\r\n\r\n&nbsp;\r\n\r\nLine. Square spiky landmasses. Below - water. Curly hair is a focus in the portrait. Eyes are large. Neck and should simple.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-bw.png"><img class="aligncenter size-large wp-image-6156" src="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-bw-1024x724.png" alt="kieraJo-bw" width="788" height="557" /></a>Simple light background with dark landmasses. Below the water is medium. Hair a mixture of dark, medium and light. Tones in face, light. Neck and shoulder are dark.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-color.png"><img class="aligncenter size-large wp-image-6157" src="http://artcontrol.me/wp-content/uploads/2015/01/kieraJo-color-1024x724.png" alt="kieraJo-color" width="788" height="557" /></a>Red hair, eyes, lips. Yellow skin. Blue sky/landmass. Green water.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/msos-line.png"><img class="aligncenter size-large wp-image-6155" src="http://artcontrol.me/wp-content/uploads/2015/01/msos-line-1024x724.png" alt="msos-line" width="788" height="557" /></a>\r\n\r\nDeveloping the landmass in the distance to a building. Spikes still everywhere. Cute frekles on her face. Her hair is wavery. Water drifting on the bottom third.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/msos-bw.png"><img class="aligncenter size-large wp-image-6153" src="http://artcontrol.me/wp-content/uploads/2015/01/msos-bw-1024x724.png" alt="msos-bw" width="788" height="557" /></a>\r\n\r\nMerging the background landmass and sky into the portrait. Skin tones light, slightly darker for the freckles. Dark for background. Light for water.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/msos-color.png"><img class="aligncenter size-large wp-image-6154" src="http://artcontrol.me/wp-content/uploads/2015/01/msos-color-1024x724.png" alt="msos-color" width="788" height="557" /></a>\r\n\r\nColour helps differ the portrait from the background. Yellow for the skin tones, along with the doors on the building in the distance. Red for hair, eyes, and mouth. Green for the water.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/logathion-line.png"><img class="aligncenter size-large wp-image-6151" src="http://artcontrol.me/wp-content/uploads/2015/01/logathion-line-1024x724.png" alt="logathion-line" width="788" height="557" /></a>\r\n\r\nTwo portraits. Glasses are always enjoyable - part of the reason I choose this. Simple spiky landmass with spike sun. Plain nothing for below the line.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/logathion-bw.png"><img class="aligncenter size-large wp-image-6149" src="http://artcontrol.me/wp-content/uploads/2015/01/logathion-bw-1024x724.png" alt="logathion-bw" width="788" height="557" /></a>\r\n\r\nThe tonal grayscale layer is simple. Ignored the water and clothing areas. Hair was dark and medium skin tones. Medium for landmass/sky. Hair is the darkest area.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/logathion-color.png"><img class="aligncenter size-large wp-image-6150" src="http://artcontrol.me/wp-content/uploads/2015/01/logathion-color-1024x724.png" alt="logathion-color" width="788" height="557" /></a>\r\n\r\nMixing it up with a very light red for the blonde on the right. Blue for the sky and landmass. Missed yellow on the necks.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-line.png"><img class="aligncenter size-large wp-image-6148" src="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-line-1024x724.png" alt="lanadelrey-line" width="788" height="557" /></a>\r\n\r\nCircus wheel happening on the left in the distance. The reference was a photograph portrait of Lana Del Rey. Spikely landmass. An ocean flows into the foreground. <a href="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-bw.png"><img class="aligncenter size-large wp-image-6146" src="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-bw-1024x724.png" alt="lanadelrey-bw" width="788" height="557" /></a>\r\n\r\nLight for the portrait. Dark for the key landmass in distance - wheel, spikes, and small islands. Medium dark for the ocean.\r\n\r\n&nbsp;\r\n\r\nRed for hair and eyes. Ignored mouth. Yellow for skin tones. Large brush strokes for the skin. Blue for the sky and landmass. Very dark blue in areas.\xa0 Green for the water - again a very dark green used.\xa0 \xa0\xa0\xa0\xa0\xa0 <a href="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-color.png"><img class="aligncenter size-large wp-image-6147" src="http://artcontrol.me/wp-content/uploads/2015/01/lanadelrey-color-1024x724.png" alt="lanadelrey-color" width="788" height="557" /></a>\r\n\r\nHope you enjoyed these digital paintings completed in gimp on my Dell laptop running Fedora 21 KDE desktop.', u'comment_count': u'0', u'tag': {u'280': {u'term_group': 0, u'count': 8, u'name': u'getsdrawn', u'parent': 0, u'term_id': 280, u'object_id': 6152, u'filter': u'raw', u'term_taxonomy_id': 304, u'taxonomy': u'post_tag', u'slug': u'getsdrawn', u'description': u''}, u'283': {u'term_group': 0, u'count': 5, u'name': u'colour', u'parent': 0, u'term_id': 283, u'object_id': 6152, u'filter': u'raw', u'term_taxonomy_id': 307, u'taxonomy': u'post_tag', u'slug': u'colour', u'description': u''}, u'59': {u'term_group': 0, u'count': 124, u'name': u'GIMP', u'parent': 0, u'term_id': 59, u'object_id': 6152, u'filter': u'raw', u'term_taxonomy_id': 60, u'taxonomy': u'post_tag', u'slug': u'gimp', u'description': u''}}, u'date': u'2015-01-02 20:24:22', u'type': u'post', u'id': u'6152', u'comment_status': u'open'}, {u'status': u'publish', u'category': [{u'term_group': 0, u'count': 84, u'name': u'Digital Painting', u'parent': 0, u'term_id': 169, u'cat_ID': 169, u'category_description': u'', u'category_parent': 0, u'object_id': 6137, u'filter': u'raw', u'category_count': 84, u'term_taxonomy_id': 181, u'cat_name': u'Digital Painting', u'taxonomy': u'category', u'category_nicename': u'digpaint', u'slug': u'digpaint', u'description': u''}], u'name': u'alibear-autumnwolf-landscapes', u'parent': u'0', u'title': u'alibear autumnwolf landscapes', u'url': u'http://artcontrol.me/?p=6137', u'author': [{u'first_name': u'Will', u'last_name': u'mckee', u'name': u'Will', u'nicename': u'wmckee', u'url': u'', u'slug': u'wmckee', u'gravatar': u'http://www.gravatar.com/avatar/5e2931ce807064cea9fc263f5346ad86?s=100&d=mm&r=g', u'id': u'1', u'description': u''}], u'excerpt': u"I'm back in Hamilton so back into digital painting. During my trip away I wrote code and drew in a notebook. It's been great to get back into the digital painting. I've", u'modified': u'2014-12-28 17:11:29', u'slug': u'alibear autumnwolf landscapes', u'content': u'I\'m back in Hamilton so back into digital painting. During my trip away I wrote code and drew in a notebook. It\'s been great to get back into the digital painting. I\'ve created two words so far:<a href="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line.png"><img class="aligncenter size-large wp-image-6140" src="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line-1024x724.png" alt="alibear-line" width="788" height="557" /></a>\r\n\r\n&nbsp;\r\n\r\nThis girl wanted turned into an Elf. I drew the giant ear she is wearing into her face. In the background, a landscape. No clouds in the sky, instead just a sun with messy spikes. Water is below.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2014/12/alibear-color.png"><img class="aligncenter size-large wp-image-6139" src="http://artcontrol.me/wp-content/uploads/2014/12/alibear-color-1024x724.png" alt="alibear-color" width="788" height="557" /></a>\r\n\r\nGrayscale tonal layer. Light skintones. Light water and sun. Medium background with dark landmass. The rightside landmass is textured nicely.\r\n\r\nI had done a colour layer for this but saved over it with the grayscale. It\'s at home and I don\'t have access to it now. I\'ll see how I go updating this post later. Other option is to not worry about it.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-line.png"><img class="aligncenter size-large wp-image-6143" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-line-1024x724.png" alt="autumnwolfmoon89-line" width="788" height="557" /></a>\r\n\r\nThe Nightmare Before Christmas. Jack Skellington is in the middle. Two people huddled around him. Horizon line down the bottom third. Similar block shapes being built up to the previous painting. These are larger and more square like than the usual spiky landmass.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-bw.png"><img class="aligncenter size-large wp-image-6141" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-bw-1024x724.png" alt="autumnwolfmoon89-bw" width="788" height="557" /></a>\r\n\r\nGrayscale. Keeping it simple and not worrying about detail - just capturing those lights and darks. Her face in partical is simple - the nose and mouth has been left out. Only two eyes stare out. Light for the skintones and dark for the clothing and hair. Light for the water and medium for the sky. Instead of going with small clouds, the sky is split with areas of zig zags.\r\n\r\n<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-color.png"><img class="aligncenter size-large wp-image-6142" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-color-1024x724.png" alt="autumnwolfmoon89-color" width="788" height="557" /></a>\r\n\r\nColour. Yellow for skin, red for hair and dark areas of clothing. Much of the clothing areas have been left alone. Blue for the sky, with a dark blue for darker areas of the sky. Green for the water.\r\n\r\n&nbsp;', u'comment_count': u'0', u'tag': {u'280': {u'term_group': 0, u'count': 8, u'name': u'getsdrawn', u'parent': 0, u'term_id': 280, u'object_id': 6137, u'filter': u'raw', u'term_taxonomy_id': 304, u'taxonomy': u'post_tag', u'slug': u'getsdrawn', u'description': u''}, u'59': {u'term_group': 0, u'count': 124, u'name': u'GIMP', u'parent': 0, u'term_id': 59, u'object_id': 6137, u'filter': u'raw', u'term_taxonomy_id': 60, u'taxonomy': u'post_tag', u'slug': u'gimp', u'description': u''}}, u'date': u'2014-12-28 17:11:29', u'type': u'post', u'id': u'6137', u'comment_status': u'open'}], u'currPage': 1, u'pages': 5}

In [9]:
lodArt = jawArt['posts']

print lodArt[1]


In [10]:
#print lodArt[0]

behArt = lodArt[1]

areArt = behArt['content']
print areArt


I'm back in Hamilton so back into digital painting. During my trip away I wrote code and drew in a notebook. It's been great to get back into the digital painting. I've created two words so far:<a href="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line.png"><img class="aligncenter size-large wp-image-6140" src="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line-1024x724.png" alt="alibear-line" width="788" height="557" /></a>

&nbsp;

This girl wanted turned into an Elf. I drew the giant ear she is wearing into her face. In the background, a landscape. No clouds in the sky, instead just a sun with messy spikes. Water is below.

<a href="http://artcontrol.me/wp-content/uploads/2014/12/alibear-color.png"><img class="aligncenter size-large wp-image-6139" src="http://artcontrol.me/wp-content/uploads/2014/12/alibear-color-1024x724.png" alt="alibear-color" width="788" height="557" /></a>

Grayscale tonal layer. Light skintones. Light water and sun. Medium background with dark landmass. The rightside landmass is textured nicely.

I had done a colour layer for this but saved over it with the grayscale. It's at home and I don't have access to it now. I'll see how I go updating this post later. Other option is to not worry about it.

<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-line.png"><img class="aligncenter size-large wp-image-6143" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-line-1024x724.png" alt="autumnwolfmoon89-line" width="788" height="557" /></a>

The Nightmare Before Christmas. Jack Skellington is in the middle. Two people huddled around him. Horizon line down the bottom third. Similar block shapes being built up to the previous painting. These are larger and more square like than the usual spiky landmass.

<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-bw.png"><img class="aligncenter size-large wp-image-6141" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-bw-1024x724.png" alt="autumnwolfmoon89-bw" width="788" height="557" /></a>

Grayscale. Keeping it simple and not worrying about detail - just capturing those lights and darks. Her face in partical is simple - the nose and mouth has been left out. Only two eyes stare out. Light for the skintones and dark for the clothing and hair. Light for the water and medium for the sky. Instead of going with small clouds, the sky is split with areas of zig zags.

<a href="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-color.png"><img class="aligncenter size-large wp-image-6142" src="http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-color-1024x724.png" alt="autumnwolfmoon89-color" width="788" height="557" /></a>

Colour. Yellow for skin, red for hair and dark areas of clothing. Much of the clothing areas have been left alone. Blue for the sky, with a dark blue for darker areas of the sky. Green for the water.

&nbsp;

In [11]:
from bs4 import BeautifulSoup

In [12]:
postData = BeautifulSoup(areArt)
#print postData

linkData = postData.find_all('a')
print linkData[0]


<a href="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line.png"><img alt="alibear-line" class="aligncenter size-large wp-image-6140" height="557" src="http://artcontrol.me/wp-content/uploads/2014/12/alibear-line-1024x724.png" width="788"/></a>

In [13]:
for link in postData.find_all('a'):
    print(link.get('href'))


http://artcontrol.me/wp-content/uploads/2014/12/alibear-line.png
http://artcontrol.me/wp-content/uploads/2014/12/alibear-color.png
http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-line.png
http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-bw.png
http://artcontrol.me/wp-content/uploads/2014/12/autumnwolfmoon89-color.png

In [14]:
txtzData = (postData.get_text())

print imgzData


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-14-b427047460bb> in <module>()
      1 txtzData = (postData.get_text())
      2 
----> 3 print imgzData
      4 

NameError: name 'imgzData' is not defined

In [ ]:
tlahArt = getArt['title']
print tlahArt

In [ ]:
dictData = {'imgz': linkData, 'text': txtzData}

print dictData

In [ ]:
getArt = requests.get('http://artcontrol.me/?wpapi=get_posts&dev=0')
jsnArt = json.loads(getArt.text)
print jsnArt

In [ ]:
print titArtpoArt = jsnArt['posts']
titArt =  poArt[0]
print titArt

In [ ]:
yaeArt = len(titArt)
print yaeArt

How can I get these 16 results in a list?

After some thought I just made a list manually. This needs to be fixed to auto collect these items


In [ ]:
lipArt = ('name','parent','title','url','author','excerpt','slug','comment_count','tag',
          'date','type','page','id','comment_status')

In [ ]:
print lipArt

In [ ]:
contArt = len(lipArt)

In [ ]:
print contArt

In [ ]:
randArt = random.randint(0,14)

In [ ]:
jerArt = lipArt[randArt]
print jerArt

In [ ]:
repArt = titArt[jerArt]
print repArt

In [13]:
titleArt = titArt['title']
print titleArt


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-13-aa3336836259> in <module>()
----> 1 titleArt = titArt['title']
      2 print titleArt

NameError: name 'titArt' is not defined

In [14]:
extrArt = titArt['excerpt']
print extrArt


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-14-9c75993f7501> in <module>()
----> 1 extrArt = titArt['excerpt']
      2 print extrArt

NameError: name 'titArt' is not defined

In [15]:
dateArt = titArt['date']
print dateArt


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-15-8ebd958c499e> in <module>()
----> 1 dateArt = titArt['date']
      2 print dateArt

NameError: name 'titArt' is not defined

In [ ]: