[{"data":1,"prerenderedAt":57},["ShallowReactive",2],{"$f3vg0fgr10h926":3,"recommended":26},{"title":4,"path":5,"date":6,"updated":7,"tags":8,"excerpt":11,"readingMinutes":12,"commentCount":13,"html":14,"comments":15,"next":20,"prev":23},"The simplest Drupal \u002F Twitter integration possible!","\u002F2011\u002F01\u002Fsimplest-drupal-twitter-integration\u002F","2011-01-05T20:24:00.002Z","2011-01-06T15:59:22.945Z",[9,10],"how-to","programming","Drupal is extremely frustrating at times. The organisation of which I manage the Drupal site got on Twitter. We only wanted a a simple block with just our latest posts. I tried three solutions before finding the perfect…",2,1,"\u003Cp>Drupal is extremely frustrating at times. The organisation of which I manage the Drupal site got on Twitter. We only wanted a a simple block with just our latest posts. I tried three solutions before finding the perfect one:\u003C\u002Fp>\n\u003Col>\n\u003Cli>The Twitter module for Drupal\u003C\u002Fli>\n\u003Cli>Another Drupal module called JUItter (\u003Ca href=\"http:\u002F\u002Fjuitter.com\u002F\">http:\u002F\u002Fjuitter.com\u002F\u003C\u002Fa>)\u003C\u002Fli>\n\u003Cli>The official Twitter widget\u003C\u002Fli>\n\u003Cli>Tweet by seaofclouds (\u003Ca href=\"http:\u002F\u002Ftweet.seaofclouds.com\u002F\">http:\u002F\u002Ftweet.seaofclouds.com\u002F\u003C\u002Fa>)\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>The last was definitely not least, I can tell you that.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>The Twitter module\u003C\u002Fstrong> \u003Cstrong>was\u003C\u002Fstrong> \u003Cstrong>terrible\u003C\u002Fstrong>, much too complicated for this simple task. Besides there is virtually \u003Cstrong>no documentation\u003C\u002Fstrong>. A shame for a module of this size! Furthermore the recommended beta didn't really work. After uninstalling (and removing the created views!) I got a long way with the previous stable version, but it seems that twitter stopped allowing old API calls and now only accepts calls made using OAuth.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>JUItter\u003C\u002Fstrong> seems nice and it is client based (a pro for social media). Above all, it has a ready to use Drupal module, or so they claim. After downloading the zip it contained only 3 files and no traces of any Drupal module. Now something might just be messed up here temporarily, but I went on right away.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>The official Twitter javascript widget\u003C\u002Fstrong> is rather ok. Just implement the generated code (which creates a twtr object and all that) in a new html Drupal block and you're done. However the script uses document.write so it has to be run by the browser before the document is fully loaded. I, like every serious programmer, like to run my javascript actions using body.onload so it won't mess up loading times for the rest of the site. There was no way to make this script load a-synchronized.\u003C\u002Fp>\n\u003Cp>Finally I thought of making a Drupal block, put some javascript jquery code in it and make an ajax call to the twitter api. From there I could parse the XML and use it to display our tweets. However, jquery does need some more configuration to be able to parse the xml file. Upon researching this I came across the best solution:\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Tweet by seaofclouds\u003C\u002Fstrong> works right away. No hassle whatsoever. It is client based, so no trouble with caching and all that. Use jquery and their .js file. The add the following code to a Drupal block:\u003C\u002Fp>\n\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\">\u003Ccode class=\"language-text\">\u003Cspan class=\"line\">\u003Cspan>&#x3C;script type=\"text\u002Fjavascript\">\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u002F\u002F &#x3C;![CDATA[\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>document.write('&#x3C;div id=\"ourtweets\">&#x3C;\u002Fdiv>');\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>$(document).ready(function() {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>$(\"#ourtweets\").tweet({\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>username: \"yourtwittername\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>join_text: \"auto\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>avatar_size: 24,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>count: 5,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>auto_join_text_default: \"we said,\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>auto_join_text_ed: \"we\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>auto_join_text_ing: \"we were\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>auto_join_text_reply: \"we replied to\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>auto_join_text_url: \"we were checking out\",\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>loading_text: \"loading tweets...\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>});\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>});\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u002F\u002F ]]>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>&#x3C;\u002Fscript>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Note that I put the creation of the div in javscript, using a document.write. This is because my Drupal configuration does not allow me to post divs in a block's source code.\u003C\u002Fp>\n\u003Cp>So once again, \u003Ca href=\"http:\u002F\u002Ftweet.seaofclouds.com\u002F\">Tweet\u003C\u002Fa> is the solution.\u003C\u002Fp>\n",[16],{"author":17,"date":18,"html":19},"valderama","2011-12-08T13:55:52.676+01:00","another really simple alternative  is this module\u003Cbr \u002F>\u003Cbr \u002F>http:\u002F\u002Fdrupal.org\u002Fproject\u002Ftwitter_pull",{"title":21,"path":22},"Is there a definitive guide to making Facebook applications?","\u002F2011\u002F01\u002Fis-there-definitive-guide-to-making\u002F",{"title":24,"path":25},"Windows software on mac","\u002F2011\u002F01\u002Fwindows-software-on-mac\u002F",[27,32,37,40,44,47,50,54],{"title":28,"path":29,"note":30,"series":31},"Mapping out Dark Code","\u002F2026\u002F03\u002Fmapping-out-dark-code\u002F","2026",false,{"title":33,"path":34,"note":35,"series":36},"The software that I love","\u002F2022\u002F10\u002Fthe-software-that-i-love\u002F","Series · 36 posts",true,{"title":38,"path":39,"note":30,"series":31},"Navigating the Fog of War: Age of Empires, AI Agents, and the Rise of Dark Code","\u002F2026\u002F05\u002Fnavigating-fog-of-war-age-of-empires-ai\u002F",{"title":41,"path":42,"note":43,"series":31},"The Future of Programming Systems - four thoughts","\u002F2024\u002F09\u002Fthe-future-of-programming-systems-four\u002F","2024",{"title":45,"path":46,"note":43,"series":31},"Always Optimize the Feedback Loop","\u002F2024\u002F07\u002Falways-optimize-feedback-loop\u002F",{"title":48,"path":49,"note":43,"series":31},"\"Security Is Our Top Priority\" is BS","\u002F2024\u002F07\u002Fsecurity-is-our-top-priority-is-bs\u002F",{"title":51,"path":52,"note":53,"series":31},"10x teams","\u002F2025\u002F02\u002F10x-teams\u002F","2025",{"title":55,"path":56,"note":53,"series":31},"Hiring, from the Other Side","\u002F2025\u002F10\u002Fhiring-from-other-side\u002F",1792876809287]