{"id":962,"date":"2017-06-12T07:00:58","date_gmt":"2017-06-12T06:00:58","guid":{"rendered":"http:\/\/exponentialdecay.co.uk\/blog\/?p=962"},"modified":"2025-11-30T16:01:49","modified_gmt":"2025-11-30T16:01:49","slug":"the-painter-goblin-part-2-twitter-pieces","status":"publish","type":"post","link":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/","title":{"rendered":"The Painter Goblin: Part 2, Twitter Pieces"},"content":{"rendered":"<p>Continuing the story of the Painter Goblin and following <a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/\" target=\"_blank\" rel=\"noopener\">part one<\/a>, the idea of a Twitter bot started to form earlier this year.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"FkxHyHBOYQ\"><p><a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/\">The Painter Goblin: Part 1, The Zine<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;The Painter Goblin: Part 1, The Zine&#8221; &#8212; ross spencer :: exponentialdecay.digipres :: blog\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/embed\/#?secret=zvbeaexDUW#?secret=FkxHyHBOYQ\" data-secret=\"FkxHyHBOYQ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>In part 2 I take a very brief look at what is needed to write a bot and get it publishing.<\/p>\n<p>Learn more below.<\/p>\n<p><!--more--><\/p>\n<h2>A head start<\/h2>\n<p>As I already run four bots, the bare-bones of the Twitter bot were already in place. Their source code repositories are below.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/exponential-decay\/binary-numbers\" target=\"_blank\" rel=\"noopener\">Binary Numbers<\/a> (updates my Avatar and stores the results in an online gallery).<\/li>\n<li><a href=\"https:\/\/github.com\/exponential-decay\/manpage-du-jour\" target=\"_blank\" rel=\"noopener\">Manpage-du-Jour<\/a> (tweets a Linux manpage daily).<\/li>\n<li><a href=\"https:\/\/github.com\/exponential-decay\/rfc-du-jour\" target=\"_blank\" rel=\"noopener\">RFC du Jour<\/a> (tweets new RFCs when they appear as well as one historical RFC a day).<\/li>\n<li><a href=\"https:\/\/github.com\/exponential-decay\/oais-du-jour\" target=\"_blank\" rel=\"noopener\">OAIS du Jour<\/a> (tweets updates from the OAIS editorial Wiki).<\/li>\n<\/ul>\n<p>At the time of writing, each bot ran from Python Anywhere service. Python Anywhere offered a low-barrier hosting mechanism for Python projects with in-built scheduling that could be easily triggered, e.g. for scheduling Tweets.<\/p>\n<p>The Twitter API as discussed in <a href=\"https:\/\/exponentialdecay.co.uk\/blog\/man-bot-homage-to-thompson-and-ritchie-and-the-linux-man-pages\/\" target=\"_blank\" rel=\"noopener\">previous blogs<\/a> is provided by <a href=\"https:\/\/github.com\/sixohsix\/twitter\" target=\"_blank\" rel=\"noopener\">SixOhSix on GitHub<\/a>.<\/p>\n<p>The neat thing is that it also, already bundled in Python Anywhere and so it doesn\u2019t take any extra work to install it when the code is uploaded to the server.<\/p>\n<h2>How to tweet<\/h2>\n<p>For those creating a Twitter Bot, it can be run from your regular Twitter account (you could run many!), but in most cases, you\u2019ll want to create a dedicated Twitter account that better identifies the project. For this work, I created the <a href=\"http:\/\/twitter.com\/paintergoblin\" target=\"_blank\" rel=\"noopener\">Painter Goblin<\/a>.<\/p>\n<h2>Authenticating your bot<\/h2>\n<p>To be able to automate your work Twitter needs to authenticate your code.. To do this we register the app via <a href=\"https:\/\/web.archive.org\/web\/20170504155405\/http:\/\/apps.twitter.com\/app\/new\" target=\"_blank\" rel=\"noopener\">Twitter&#8217;s App Registration<\/a>.<\/p>\n<p><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: small;\"><a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/register-app\/\" rel=\"attachment wp-att-963\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-963\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/register-app.png\" alt=\"Register a Twitter Application\" width=\"1319\" height=\"576\" srcset=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/register-app.png 1319w, https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/register-app-300x131.png 300w, https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/register-app-768x335.png 768w, https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/register-app-1024x447.png 1024w\" sizes=\"auto, (max-width: 1319px) 100vw, 1319px\" \/><\/a><\/span><\/span><\/p>\n<p>There are two files the Twitter API by SixOhSix uses to handle authentication with the service. A set of two consumer keys, and a set of two application keys.<\/p>\n<p><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: small;\"><a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/consumer-keys\/\" rel=\"attachment wp-att-964\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-964\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/consumer-keys.png\" alt=\"Twitter Application Keys\" width=\"1008\" height=\"138\" srcset=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/consumer-keys.png 1008w, https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/consumer-keys-300x41.png 300w, https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/consumer-keys-768x105.png 768w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/a><\/span><\/span><\/p>\n<p>With those in place you point the Twitter API to the information and <a href=\"https:\/\/github.com\/ross-spencer\/painter-goblin\/blob\/a7bbba8df17899287f64332ef6ecd9f95f2e0a6b\/core\/lib\/twitterpieces.py\" target=\"_blank\" rel=\"noopener\">off you go<\/a>.<\/p>\n<p>Sending a Tweet becomes a two (or see-below, three-step) process.<\/p>\n<ul>\n<li>Create a Twitter object and authenticate<\/li>\n<li>Send the Tweet via your new object<\/li>\n<\/ul>\n<h2>Changes since previous Twitter Bots<\/h2>\n<p>The API has changed\u00a0since the last bot I created. It still has 140 character limits for posts. It also still shortens (or lengthens!) any URL of any length to 22 characters. This needs to be built into a heuristic when dynamically generating text for any Tweet we\u2019re going to make.<\/p>\n<p>A change that has really helped with making a bot is that images no longer count toward the 140 character limit. One less thing to think about! And a bonus for any bots that want to be more visual.<\/p>\n<h2>Uploading images<\/h2>\n<p>Uploading images is something I haven\u2019t done before. Fortunately the SixOhSix README has a great section on how to \u2018Send images along with your tweets\u2019. Interestingly, to send an image with a Tweet is a three-step process, first it requires authentication, and then the image is uploaded to the Twitter dedicated server, which then returns an image key that is then sent with your text.<\/p>\n<pre># Send images along with your tweets:\r\n\r\n# - first just read images from the web or from files the regular way:\r\nwith open(\"example.png\", \"rb\") as imagefile:\r\nimagedata = imagefile.read()\r\n\r\n# - then upload medias one by one on Twitter's dedicated server\r\n# and collect each one's id:\r\nt_upload = Twitter(domain='upload.twitter.com',\r\nauth=OAuth(token, token_secret, consumer_key, consumer_secret))\r\nid_img1 = t_upload.media.upload(media=imagedata)[\"media_id_string\"]\r\nid_img2 = t_upload.media.upload(media=imagedata)[\"media_id_string\"]\r\n\r\n# - finally send your tweet with the list of media ids:\r\nt.statuses.update(status=\"PTT \u2605\", media_ids=\",\".join([id_img1, id_img2]))<\/pre>\n<p>One issue discovered in testing was that the SixOhSix API versioning on Python Anywhere was behind the most recent code on GitHub \u2013 I implemented legacy code to match the versions on the server but I have also implemented the up-to-date mechanism so as to future-proof things a little bit more.<\/p>\n<h2>Lessons learned from before<\/h2>\n<p>In creating this new code I wanted to make up for a few shortcomings. There were two design decisions I was able to incorporate, namely:<\/p>\n<ul>\n<li>The ability to test Tweets with a <code>\u2013notweet<\/code> flag.<\/li>\n<li>Improved ability to run code manually.<\/li>\n<\/ul>\n<p>The latter is a feature I was particularly keen on. While I like the idea of Painter Goblin as an art project, there are times it is nice to be able to run the process manually on special occasions\u00a0for others, or at their request. Or just for fun to make new art for yourself.<\/p>\n<p>We\u2019ll see how this progresses in future posts as we get into the visual detail of the project.<\/p>\n<h2>Botwiki<\/h2>\n<p>I mentioned my four twitter bots &#8211; you can read more about those <a href=\"https:\/\/botwiki.org\/bot\/?tags=beet-keeper\" target=\"_blank\" rel=\"noopener\">on Botwiki<\/a> but checkout the <a href=\"https:\/\/botwiki.org\/\" target=\"_blank\" rel=\"noopener\">entire Botwiki Website<\/a> to learn more about Creating Bots, and learn more about those that already exist and the joy they brought to social media platforms before being unilaterally banned on some of the biggest ones.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_962\" class=\"pvc_stats total_only  \" data-element-id=\"962\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Continuing the story of the Painter Goblin and following <a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/\" target=\"_blank\" rel=\"noopener\">part one<\/a>, the idea of a Twitter bot started to form earlier this year.<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"FkxHyHBOYQ\"><p><a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/\">The Painter Goblin: Part 1, The Zine<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;The Painter Goblin: Part 1, The Zine&#8221; &#8212; ross spencer :: exponentialdecay.digipres :: blog\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-1-the-zine\/embed\/#?secret=zvbeaexDUW#?secret=FkxHyHBOYQ\" data-secret=\"FkxHyHBOYQ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>In part 2 I take a very brief look at what is needed to write a bot and get it publishing.<\/p>\n<p>Learn more below.<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;The Painter Goblin: Part 2, Twitter Pieces&rdquo;<\/span>&hellip;<\/a><\/div>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_962\" class=\"pvc_stats total_only  \" data-element-id=\"962\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":965,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"quiet_public","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[114,20,135,19],"tags":[96,179,115,68,121,132,131,120,64,122,119],"class_list":["post-962","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital-literacy","category-just-code","category-painter-goblin","category-python","tag-coding","tag-coding-lessons","tag-digital-literacy","tag-generative-art","tag-open-data","tag-painter-goblin","tag-paintergoblin","tag-the-painter-goblin","tag-twitter","tag-twitter-bot","tag-wikidata","entry"],"a3_pvc":{"activated":true,"total_views":2219,"today_views":0},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Painter Goblin: Part 2, Twitter Pieces<\/title>\n<meta name=\"description\" content=\"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Painter Goblin: Part 2, Twitter Pieces\" \/>\n<meta property=\"og:description\" content=\"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/\" \/>\n<meta property=\"og:site_name\" content=\"ross spencer :: exponentialdecay.digipres :: blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-12T06:00:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-30T16:01:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1089\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ross Spencer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@beet_keeper\" \/>\n<meta name=\"twitter:site\" content=\"@beet_keeper\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ross Spencer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/\"},\"author\":{\"name\":\"Ross Spencer\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/4cae0a954400f42b9c1b70c699837716\"},\"headline\":\"The Painter Goblin: Part 2, Twitter Pieces\",\"datePublished\":\"2017-06-12T06:00:58+00:00\",\"dateModified\":\"2025-11-30T16:01:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/\"},\"wordCount\":738,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/4cae0a954400f42b9c1b70c699837716\"},\"image\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg\",\"keywords\":[\"Coding\",\"Coding Lessons\",\"digital literacy\",\"Generative Art\",\"Open Data\",\"painter goblin\",\"paintergoblin\",\"The Painter Goblin\",\"Twitter\",\"Twitter Bot\",\"wikidata\"],\"articleSection\":[\"Digital Literacy\",\"Just Code\",\"Painter Goblin\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/\",\"url\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/\",\"name\":\"The Painter Goblin: Part 2, Twitter Pieces\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg\",\"datePublished\":\"2017-06-12T06:00:58+00:00\",\"dateModified\":\"2025-11-30T16:01:49+00:00\",\"description\":\"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#primaryimage\",\"url\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg\",\"contentUrl\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg\",\"width\":1089,\"height\":620,\"caption\":\"Japanese Print\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/the-painter-goblin-part-2-twitter-pieces\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Painter Goblin: Part 2, Twitter Pieces\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/\",\"name\":\"ross spencer :: exponentialdecay.digipres :: blog\",\"description\":\"Digital preservation analyst, researcher, and software developer\",\"publisher\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/4cae0a954400f42b9c1b70c699837716\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/4cae0a954400f42b9c1b70c699837716\",\"name\":\"Ross Spencer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/avatar-scaled.png\",\"url\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/avatar-scaled.png\",\"contentUrl\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/avatar-scaled.png\",\"width\":2560,\"height\":2560,\"caption\":\"Ross Spencer\"},\"logo\":{\"@id\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/avatar-scaled.png\"},\"description\":\"Digital preservation domain expert and full-stack software developer.\",\"sameAs\":[\"http:\\\/\\\/www.exponentialdecay.co.uk\\\/blog\",\"https:\\\/\\\/www.instagram.com\\\/b33tk33p3r\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ross-spencer-b6b9b758\\\/\",\"https:\\\/\\\/x.com\\\/beet_keeper\"],\"url\":\"https:\\\/\\\/exponentialdecay.co.uk\\\/blog\\\/author\\\/exponentialdecay\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Painter Goblin: Part 2, Twitter Pieces","description":"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/","og_locale":"en_US","og_type":"article","og_title":"The Painter Goblin: Part 2, Twitter Pieces","og_description":"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.","og_url":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/","og_site_name":"ross spencer :: exponentialdecay.digipres :: blog","article_published_time":"2017-06-12T06:00:58+00:00","article_modified_time":"2025-11-30T16:01:49+00:00","og_image":[{"width":1089,"height":620,"url":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg","type":"image\/jpeg"}],"author":"Ross Spencer","twitter_card":"summary_large_image","twitter_creator":"@beet_keeper","twitter_site":"@beet_keeper","twitter_misc":{"Written by":"Ross Spencer","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#article","isPartOf":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/"},"author":{"name":"Ross Spencer","@id":"https:\/\/exponentialdecay.co.uk\/blog\/#\/schema\/person\/4cae0a954400f42b9c1b70c699837716"},"headline":"The Painter Goblin: Part 2, Twitter Pieces","datePublished":"2017-06-12T06:00:58+00:00","dateModified":"2025-11-30T16:01:49+00:00","mainEntityOfPage":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/"},"wordCount":738,"commentCount":1,"publisher":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/#\/schema\/person\/4cae0a954400f42b9c1b70c699837716"},"image":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#primaryimage"},"thumbnailUrl":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg","keywords":["Coding","Coding Lessons","digital literacy","Generative Art","Open Data","painter goblin","paintergoblin","The Painter Goblin","Twitter","Twitter Bot","wikidata"],"articleSection":["Digital Literacy","Just Code","Painter Goblin","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/","url":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/","name":"The Painter Goblin: Part 2, Twitter Pieces","isPartOf":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#primaryimage"},"image":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#primaryimage"},"thumbnailUrl":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg","datePublished":"2017-06-12T06:00:58+00:00","dateModified":"2025-11-30T16:01:49+00:00","description":"A brief introduction into how to automate publishing if you are interested in writing a bot for the social media platform, Twitter.","breadcrumb":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#primaryimage","url":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg","contentUrl":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2017\/06\/DBerWDMXsAA-Gax.jpg-large-e1496641570744.jpg","width":1089,"height":620,"caption":"Japanese Print"},{"@type":"BreadcrumbList","@id":"https:\/\/exponentialdecay.co.uk\/blog\/the-painter-goblin-part-2-twitter-pieces\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/exponentialdecay.co.uk\/blog\/"},{"@type":"ListItem","position":2,"name":"The Painter Goblin: Part 2, Twitter Pieces"}]},{"@type":"WebSite","@id":"https:\/\/exponentialdecay.co.uk\/blog\/#website","url":"https:\/\/exponentialdecay.co.uk\/blog\/","name":"ross spencer :: exponentialdecay.digipres :: blog","description":"Digital preservation analyst, researcher, and software developer","publisher":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/#\/schema\/person\/4cae0a954400f42b9c1b70c699837716"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exponentialdecay.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/exponentialdecay.co.uk\/blog\/#\/schema\/person\/4cae0a954400f42b9c1b70c699837716","name":"Ross Spencer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2025\/06\/avatar-scaled.png","url":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2025\/06\/avatar-scaled.png","contentUrl":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2025\/06\/avatar-scaled.png","width":2560,"height":2560,"caption":"Ross Spencer"},"logo":{"@id":"https:\/\/exponentialdecay.co.uk\/blog\/wp-content\/uploads\/2025\/06\/avatar-scaled.png"},"description":"Digital preservation domain expert and full-stack software developer.","sameAs":["http:\/\/www.exponentialdecay.co.uk\/blog","https:\/\/www.instagram.com\/b33tk33p3r\/","https:\/\/www.linkedin.com\/in\/ross-spencer-b6b9b758\/","https:\/\/x.com\/beet_keeper"],"url":"https:\/\/exponentialdecay.co.uk\/blog\/author\/exponentialdecay\/"}]}},"views":3233,"_links":{"self":[{"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/posts\/962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=962"}],"version-history":[{"count":6,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":2806,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/posts\/962\/revisions\/2806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/media\/965"}],"wp:attachment":[{"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exponentialdecay.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}