From ceb5af118bfb2e0c455a83e8b6cb2b76cfe1259e Mon Sep 17 00:00:00 2001 From: Toby Thain Date: Sun, 28 Apr 2013 14:52:29 -0400 Subject: [PATCH] Add basic SBT build configuration. --- build.sbt | 26 ++++++++++++++ .../com/gravity/goose/TalkToMeGoose.scala | 36 +++++++++++-------- 2 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 build.sbt diff --git a/build.sbt b/build.sbt new file mode 100644 index 000000000..0e1bdf902 --- /dev/null +++ b/build.sbt @@ -0,0 +1,26 @@ +name := "Goose" + +version := "2.1.22" + +organization := "GravityLabs" + +organizationHomepage := Some(url("http://gravity.com/")) + +homepage := Some(url("https://github.com/GravityLabs/goose")) + +description := "Extracts text, metadata, and key image from web articles." + +licenses += "Apache2" -> url("http://www.apache.org/licenses/") + +// scalacOptions ++= Seq("-unchecked", "-deprecation") + +libraryDependencies ++= Seq( + "junit" % "junit" % "4.8.1" % "test", + "org.slf4j" % "slf4j-api" % "1.6.1" % "compile", + "org.slf4j" % "slf4j-log4j12" % "1.6.1" % "test", + "org.slf4j" % "slf4j-simple" % "1.6.1", + "org.jsoup" % "jsoup" % "1.5.2", + "commons-io" % "commons-io" % "2.0.1", + "org.apache.httpcomponents" % "httpclient" % "4.1.2", + "commons-lang" % "commons-lang" % "2.6" +) diff --git a/src/main/scala/com/gravity/goose/TalkToMeGoose.scala b/src/main/scala/com/gravity/goose/TalkToMeGoose.scala index fba111b88..e4351c99c 100644 --- a/src/main/scala/com/gravity/goose/TalkToMeGoose.scala +++ b/src/main/scala/com/gravity/goose/TalkToMeGoose.scala @@ -7,21 +7,27 @@ package com.gravity.goose */ object TalkToMeGoose { /** - * you can use this method if you want to run goose from the command line to extract html from a bashscript - * or to just test it's functionality - * you can run it like so - * cd into the goose root - * mvn compile - * MAVEN_OPTS="-Xms256m -Xmx2000m"; mvn exec:java -Dexec.mainClass=com.gravity.goose.TalkToMeGoose -Dexec.args="http://techcrunch.com/2011/05/13/native-apps-or-web-apps-particle-code-wants-you-to-do-both/" -e -q > ~/Desktop/gooseresult.txt - * - * Some top gun love: - * Officer: [in the midst of the MIG battle] Both Catapults are broken, sir. - * Stinger: How long will it take? - * Officer: It'll take ten minutes. - * Stinger: Bullshit ten minutes! This thing will be over in two minutes! Get on it! - * - * @param args - */ + * You can use this method to run goose from the command line + * to extract html from a bash script, or to just test its functionality: + * + * cd into the goose root + * mvn compile + * MAVEN_OPTS="-Xms256m -Xmx2000m"; mvn exec:java -Dexec.mainClass=com.gravity.goose.TalkToMeGoose -Dexec.args="http://techcrunch.com/2011/05/13/native-apps-or-web-apps-particle-code-wants-you-to-do-both/" -e -q > ~/Desktop/gooseresult.txt + * + * or if using sbt: + * + * cd into the goose root + * sbt + * > run http://www.thestar.com/news/insight/2013/04/26/spotting_tiny_gnatcatcher_can_put_a_spring_in_your_step.html + * + * Some top gun love: + * Officer: [in the midst of the MIG battle] Both Catapults are broken, sir. + * Stinger: How long will it take? + * Officer: It'll take ten minutes. + * Stinger: Bullshit ten minutes! This thing will be over in two minutes! Get on it! + * + * @param args + */ def main(args: Array[String]) { try { val url: String = args(0)