Skip to content

Commit

Permalink
updated how to get the jar from repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed Nov 26, 2011
1 parent 4882733 commit c81bf1d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
nb-configuration.xml
nbactions.xml
*~
*~
deploy-jar-to-mvnrepo-at-github.sh
24 changes: 17 additions & 7 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,27 @@ The disadvantages to Goose are
* some articles which passed do not pass.
But added a bunch of other useful sites (stackoverflow, facebook, other languages ...)

= Build

via Maven. Maven will automatically resolve dependencies to jsoup, log4j and slf4j-api

= Usage
Include the repo at see README: https://github.com/karussell/mvnrepo
Then add the dependency
<dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

Now you can use it as follows:

HtmlFetcher fetcher = new HtmlFetcher();
// set cache. e.g. take the map implementation from google collections:
// fetcher.setCache(new MapMaker().concurrencyLevel(20).
// maximumSize(count).expireAfterWrite(minutes,
// TimeUnit.MINUTES).makeMap();
JResult res = fetcher.fetchAndExtract(url, resolveTimeout, true);
// fetcher.setCache(new MapMaker().concurrencyLevel(20).maximumSize(count).expireAfterWrite(minutes, TimeUnit.MINUTES).makeMap();

JResult res = fetcher.fetchAndExtract(articleUrl, resolveTimeout, true);
String text = res.getText();
String title = res.getTitle();
String imageUrl = res.getImageUrl();

= Build

via Maven. Maven will automatically resolve dependencies to jsoup, log4j and slf4j-api
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,10 @@
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>karussell_snapshot</id>
<url>https://github.com/karussell/mvnrepo/raw/master/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

0 comments on commit c81bf1d

Please sign in to comment.