Skip to content

Instantly share code, notes, and snippets.

@hexx
hexx / get-tumblr-avatar.scala
Created March 4, 2012 17:22
Get Tumblr Avatar
#!/usr/bin/env scalas
!#
/***
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.8"
*/
import dispatch._
val http = new Http
@hexx
hexx / get-tumblr-title.scala
Created March 6, 2012 04:02
Get Tumblr Title
#!/usr/bin/env scalas
!#
/***
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-http" % "0.8.8",
"net.databinder" %% "dispatch-http-json" % "0.8.8"
)
*/
@hexx
hexx / post-tumblr.scala
Created March 15, 2012 08:46
Post Tumblr
#!/usr/bin/env scalas
!#
/***
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-http" % "0.8.8",
"net.databinder" %% "dispatch-oauth" % "0.8.8"
)
*/
@hexx
hexx / build.sbt
Created March 24, 2012 02:02
Dispatch Tumblr build.sbt
organization := "com.github.hexx"
name := "dispatch-tumblr"
version := "0.0.1"
scalaVersion := "2.9.1"
scalacOptions += "-deprecation"
@hexx
hexx / tumblr-dashboard.scala
Created March 24, 2012 03:54
Tumblr Dushboard
#!/usr/bin/env scalas
!#
/***
libraryDependencies += "com.github.hexx" %% "dispatch-tumblr" % "0.0.1"
*/
import dispatch._
import dispatch.oauth.Consumer
import dispatch.json.JsHttp._
@hexx
hexx / Tumblr.scala
Created March 25, 2012 12:52
Dispatch Tumblr Tumblr.scala
package com.github.hexx.dispatch.tumblr
import dispatch._
import dispatch.json.JsHttp._
import dispatch.json.{ Js, JsObject }
import dispatch.oauth.OAuth
import dispatch.oauth.OAuth._
import dispatch.oauth.{ Consumer, Token }
object Tumblr {
@hexx
hexx / TumblrSpec.scala
Created March 25, 2012 13:56
Dispatch Tumblr TumblrSpec.scala
import org.specs2.mutable._
import com.github.hexx.dispatch.tumblr._
class TumblrSpec extends Specification {
import dispatch._
import dispatch.json.Js
import dispatch.json.JsHttp._
import dispatch.oauth.{ Consumer, Token }
@hexx
hexx / Scalamblr.scala
Created April 13, 2012 17:17
Giter8 Template for Conscript
package com.github.hexx
/** The launched conscript entry point */
class App extends xsbti.AppMain {
def run(config: xsbti.AppConfiguration) = {
Exit(App.run(config.arguments))
}
}
object App {
@hexx
hexx / Scalamblr.scala
Created April 14, 2012 07:58
Scalamblr
package com.github.hexx.scalamblr
import scala.io.Source
import com.twitter.util.Eval
import dispatch._
import dispatch.oauth.Consumer
import scopt._
import com.github.hexx.dispatch.tumblr._
trait Config {
@hexx
hexx / config.scala
Created April 14, 2012 08:22
Scalamblr Config
import com.github.hexx.scalamblr.Config
new Config {
val defaultHostname = "YOUR HOSTNAME"
override val markdown = true
val consumerKey = "YOUR CONSUMER KEY"
val consumerSecret = "YOUR CONSUMER SECRET"
val username = "YOUR USERNAME"
val password = "YOUR PASSWORD"
}