Skip to content

Instantly share code, notes, and snippets.

@gyoh
gyoh / YouTubeUploader.scala
Created March 27, 2011 13:14
A simple script to upload videos to YouTube and embed links to Tumblr.
import io.Source
import tools.nsc.io.{Path, File}
import java.text.SimpleDateFormat
import java.util.Date
import java.net.URL
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.methods.HttpPost
import org.apache.http.entity.BufferedHttpEntity
import org.apache.http.client.entity.UrlEncodedFormEntity
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("maps", "3", {other_params: "sensor=false&language=ja&region=JP"});
function codeAddress() {
var address = $("#address").val();
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$("#location").val(results[0].geometry.location);
@gyoh
gyoh / Album2Tumblr.scala
Created March 8, 2011 03:11
A simple script to import picture from Shun Album to Tumblr.
import collection.JavaConversions._
import io.Source
import xml.{NodeSeq, XML, Elem, Node}
import tools.nsc.io.{Path, File, Directory}
import java.io._
import java.nio.charset.Charset
import java.text.SimpleDateFormat
import java.util.{ArrayList, Calendar}
import org.apache.http.impl.client.DefaultHttpClient
@gyoh
gyoh / Twitter2Tumblr.scala
Created February 28, 2011 15:49
A simple script to import tweets into tumblr.
import collection.JavaConversions._
import io.Source
import xml.{NodeSeq, XML, Elem, Node}
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.methods.HttpPost
import org.apache.http.params.BasicHttpParams
import org.apache.http.entity.BufferedHttpEntity
import org.apache.http.entity.StringEntity
import org.apache.http.client.entity.UrlEncodedFormEntity