{"id":1991,"date":"2013-02-07T17:52:26","date_gmt":"2013-02-07T15:52:26","guid":{"rendered":"http:\/\/planetozh.com\/blog\/?p=1991"},"modified":"2013-02-07T17:54:01","modified_gmt":"2013-02-07T15:54:01","slug":"i-dont-speak-parseltongue-but-i-speak-php","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2013\/02\/i-dont-speak-parseltongue-but-i-speak-php\/","title":{"rendered":"I don&#8217;t speak Parseltongue, but I speak PHP"},"content":{"rendered":"<p>Here is a story about a guy who tried to speak a language he didn&#39;t know. Like Twilight, there are several chapters in that story, but don&#39;t worry, it&#39;s not about sissy hormone troubled teenagers trying to grasp the meaning of life.<\/p>\n<p><!--more--><\/p>\n<h2>Chapter 1: Consternation<\/h2>\n<p>Three days ago, I spent some time looking for existing tools to migrate issues from a Google Project to Github. I found different scripts, in Ruby, Perl and Python.<\/p>\n<p>First, I wasted quite some time getting the scripts to run because I was missing dependencies or modules and, depending on the language, it&#39;s more or less obvious how to add them (while I&#39;m at it: Perl, it&#39;s been a long time. I hope it&#39;ll be another long time).<\/p>\n<p>None of these scripts really suited my needs, so I wasted some more time trying to customize them, but I failed because what I wanted to do was a bit more complex than what my limited understanding of these languages allow me. I don&#39;t speak Python.<\/p>\n<pre style=\"color: #712525;font-size: 120%;\">\r\n  try and edit Ruby, Perl then Python scripts\r\n+ fail \r\n+ go to sleep angry because of wasted evening\r\n---------------------------------------------\r\n= 3 hours\r\n<\/pre>\n<p><strong>Morale of that first chapter<\/strong>: don&#39;t try to speak Japanese if you don&#39;t speak Japanese.<\/p>\n<h2>Chapter 2: PHPfication<\/h2>\n<p>Then I got a dramatic revelation: &quot;Jeeeez, st00pid, why don&#39;t you just code it yourself? Duh!!&quot;. Indeed, as I first went and search for something already existing, and slowly got dragged into wasting more time, I just haven&#39;t had the idea. But looking at that Python script (man, I was *this* close to hack it the way I needed :) something obvious surfaced: working with Github&#39;s API and its OAuth stuff is plain easy (makes me wonder why it&#39;s such a pain in the ass with Twitter, for instance)<\/p>\n<p>So, I started from an empty <tt>migrate.php<\/tt> and in less time than what you need to spell &quot;supercalifragilisticexpialidocious&quot;, I got the perfect script for my needs.<\/p>\n<pre style=\"color: #712525;font-size: 120%;\">\r\n  code in PHP from scratch\r\n+ create at least 50 repos on Github to test and fine tune\r\n+ success\r\n+ write documentation\r\n+ feel like an open source superhero\r\n+ impress my kids during next breakfast\r\n----------------------------------------------------------\r\n= 3 hours. Or maybe 6 or 9, but hey, time flies when you're having fun!\r\n<\/pre>\n<h2>Chapter 3: Publification<\/h2>\n<p>To know more about that script (promise, no more stupid chapter names!) go there: <a href=\"http:\/\/planetozh.com\/blog\/my-projects\/google-issues-to-github-a-migration-script-in-php\/\">Google Issues To Github : a Migration Script in PHP<\/a><\/p>\n<h2>Final thoughts<\/h2>\n<p>Yes, I&#39;m most probably moving YOURLS to Github. No, there&#39;s no announced ETA :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a story about a guy who tried to speak a language he didn&#39;t know. Like Twilight, there are several chapters in that story, but don&#39;t worry, it&#39;s not about sissy hormone troubled teenagers trying to grasp the meaning of life.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[397,42,401,10],"class_list":["post-1991","post","type-post","status-publish","format-standard","hentry","category-published","tag-github","tag-google","tag-harry-potter","tag-php"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=1991"}],"version-history":[{"count":9,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1991\/revisions"}],"predecessor-version":[{"id":2003,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/1991\/revisions\/2003"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=1991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=1991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=1991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}