From 3757796329a8457e2b50033fd3fa01daecb81233 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 26 May 2011 08:03:40 -0400 Subject: [PATCH 01/19] Fixes tests --- src/test/features/objectify.feature | 2 +- src/test/features/oembed.feature | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/features/objectify.feature b/src/test/features/objectify.feature index 1ac712d..a56e212 100644 --- a/src/test/features/objectify.feature +++ b/src/test/features/objectify.feature @@ -11,4 +11,4 @@ Feature: Objectify Examples: | url | metadesc | - | http://tweetphoto.com/14784358 | Plixi allows user to ins | + | http://yfrog.com/h855mugj | yfrog free image and vid | diff --git a/src/test/features/oembed.feature b/src/test/features/oembed.feature index 341babb..6f4a1b6 100644 --- a/src/test/features/oembed.feature +++ b/src/test/features/oembed.feature @@ -14,7 +14,7 @@ Feature: OEmbed | http://www.scribd.com/doc/13994900/Easter | http://www.scribd.com/ | | http://www.scribd.com/doc/28452730/Easter-Cards | http://www.scribd.com/ | | http://www.youtube.com/watch?v=Zk7dDekYej0 | http://www.youtube.com/ | - | http://tweetphoto.com/14784358 | http://plixi.com | + | http://yfrog.com/h855mugj | http://yfrog.com | Scenario Outline: Get the types @@ -27,7 +27,7 @@ Feature: OEmbed | http://www.scribd.com/doc/13994900/Easter | rich | | http://www.scribd.com/doc/28452730/Easter-Cards | rich | | http://www.youtube.com/watch?v=Zk7dDekYej0 | video | - | http://tweetphoto.com/14784358 | photo | + | http://yfrog.com/h855mugj | photo | Scenario Outline: Get the provider_url with force flag @@ -48,7 +48,7 @@ Feature: OEmbed Examples: | urls | provider_urls | | http://www.scribd.com/doc/13994900/Easter,http://www.scribd.com/doc/28452730/Easter-Cards | http://www.scribd.com/,http://www.scribd.com/ | - | http://www.youtube.com/watch?v=Zk7dDekYej0,http://plixi.com/p/16044847 | http://www.youtube.com/,http://plixi.com | + | http://www.youtube.com/watch?v=Zk7dDekYej0,http://yfrog.com/h855mugj | http://www.youtube.com/,http://yfrog.com | Scenario Outline: Get the provider_url with pro @@ -87,8 +87,8 @@ Feature: OEmbed | urls | errcode | types | | http://www.youtube.com/watch/a/bassd/url,http://www.youtube.com/watch/ldf/asdlfj | 404,404 | error,error | | http://www.scribd.com/doc/lsbsdlfldsf/kl,http://www.scribd.com/doc/zasdf/asdfl | 404,404 | error,error | - | http://www.youtube.com/watch/zzzzasdf/kl,http://tweetphoto.com/14784358 | 404, | error,photo | - | http://tweetphoto.com/14784358,http://www.scribd.com/doc/asdfasdfasdf | ,404 | photo,error | + | http://www.youtube.com/watch/zzzzasdf/kl,http://yfrog.com/h855mugj | 404, | error,photo | + | http://yfrog.com/h855mugj,http://www.scribd.com/doc/asdfasdfasdf | ,404 | photo,error | Scenario Outline: Attempt at non-api service without key Given an embedly host From b73098aff081eed7d07e929e0d720baec7aecdda Mon Sep 17 00:00:00 2001 From: Zach Dicklin Date: Wed, 25 May 2011 21:53:31 -0600 Subject: [PATCH 02/19] Added option to set SO_TIMEOUT, a timeout on blocking Socket operations. --- src/main/java/com/embedly/api/Api.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index 8ebedf1..0f3d5f2 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -17,9 +17,10 @@ import org.json.JSONObject; import org.apache.http.client.ResponseHandler; -import org.apache.http.client.HttpClient; import org.apache.http.impl.client.BasicResponseHandler; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; /** * Api is used to access the Embedly API and Pro endpoints. @@ -29,7 +30,7 @@ public class Api { private String host; private String userAgent; - private HttpClient _httpClient; + private DefaultHttpClient _httpClient; private ResponseHandler _responseHandler; public Api(String userAgent) { @@ -293,4 +294,14 @@ private ResponseHandler getResponseHandler() { return _responseHandler; } + /** + * Set Timeout on Blocking Socket Operations + * @param timeout Timeout in milliseconds + */ + public void setSoTimeout( int timeout ) { + DefaultHttpClient client = getHttpClient(); + HttpParams params = client.getParams(); + HttpConnectionParams.setSoTimeout( params, timeout ); + client.setParams( params ); + } } From 8cc1efd85802f4c4405f94c116f1521e8d8f6e9c Mon Sep 17 00:00:00 2001 From: Zach Dicklin Date: Wed, 25 May 2011 22:07:57 -0600 Subject: [PATCH 03/19] Fixed return type --- src/main/java/com/embedly/api/Api.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index 0f3d5f2..9b6f584 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -280,7 +280,8 @@ public static void setLog(Log log) { Utils.setLog(log); } - private HttpClient getHttpClient() { + private DefaultHttpClient getHttpClient() { + if (_httpClient == null) { _httpClient = new DefaultHttpClient(); } From b73795e83245db81d37ca6135bb513abdf0507aa Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 26 May 2011 08:40:21 -0400 Subject: [PATCH 04/19] Updates README --- README.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.markdown b/README.markdown index a2f2740..1ad27d8 100644 --- a/README.markdown +++ b/README.markdown @@ -6,6 +6,14 @@ http://api.embed.ly/docs. ## Installing +We keep the latest release on MavenCentral. + + + com.embedly + embedly-api + 0.1.2 + + If you would like cutting edge, then you can clone and install HEAD. git clone git@github.com:dokipen/embedly-java.git From a240a8dc6604de5d599e6aa6fb2d9b9e75469728 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 26 May 2011 08:40:30 -0400 Subject: [PATCH 05/19] Bumps version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index cd60fff..5b1290c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'eclipse' apply plugin:com.smokejumperit.gradle.CukePlugin apply plugin:de.huxhorn.gradle.pgp.PgpPlugin -version = '0.1.2-SNAPSHOT' +version = '0.1.2' configurations { runtime.exclude module: 'groovy' From 149b24619cdb922a469cf22f17a9644f129911a7 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 26 May 2011 08:50:33 -0400 Subject: [PATCH 06/19] bumps version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5b1290c..b4141a0 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'eclipse' apply plugin:com.smokejumperit.gradle.CukePlugin apply plugin:de.huxhorn.gradle.pgp.PgpPlugin -version = '0.1.2' +version = '0.1.3-SNAPSHOT' configurations { runtime.exclude module: 'groovy' From 42b2ff2e40d27ed68a6ba29563510f5029f862e0 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:06:49 -0400 Subject: [PATCH 07/19] Fixes bad example --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 1ad27d8..759aa10 100644 --- a/README.markdown +++ b/README.markdown @@ -35,7 +35,7 @@ If you would like cutting edge, then you can clone and install HEAD. public class Demo { public static void main(String[] args) { Api.setLog(LogFactory.getLog(Api.class)); - Api api = new API('Mozilla/5.0 (compatible; mytestapp/1.0; my@email.com)'); + Api api = new Api('Mozilla/5.0 (compatible; mytestapp/1.0; my@email.com)'); HashMap params = new HashMap(); params.put('url', 'http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos'); From 1aab364e0117475b399551e7fe6974eb7a5de80c Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:07:03 -0400 Subject: [PATCH 08/19] Always use api.embed.ly --- src/main/java/com/embedly/api/Api.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index 9b6f584..db50cc2 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -74,10 +74,8 @@ public Api(String userAgent, String key, String host) { "Api object"); } - if (this.key == null && this.host == null) { + if (this.host == null) { this.host = "http://api.embed.ly"; - } else if (this.host == null) { - this.host = "http://pro.embed.ly"; } // prime these From 6a50d44522e0a614b1477018806eddc890fac69b Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:07:45 -0400 Subject: [PATCH 09/19] Fixes collections as params --- src/main/java/com/embedly/api/Api.java | 13 ++++++++++-- .../java/com/embedly/api/ApiParameters.java | 20 +++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index db50cc2..4db61ba 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -219,15 +219,24 @@ public String toString() { * * @return JSONArray of JSONObjects. */ - private JSONArray apicall(String version, String action, + @SuppressWarnings("unchecked") + private JSONArray apicall(String version, String action, Map params) { ResponseMaker resp = new ResponseMaker(); try { ApiParameters query = new ApiParameters(); for (Map.Entry entry : params.entrySet()) { - if (entry.getValue() instanceof String[]) { + if (entry.getValue() instanceof String[]) { query.push(entry.getKey().toString(), (String[])entry.getValue()); + } else if (entry.getValue() instanceof java.util.Collection) { + try { + query.push(entry.getKey().toString(), + (java.util.Collection)entry.getValue()); + } catch(Exception e) { + query.push(entry.getKey().toString(), + entry.getValue().toString()); + } } else { query.push(entry.getKey().toString(), entry.getValue().toString()); diff --git a/src/main/java/com/embedly/api/ApiParameters.java b/src/main/java/com/embedly/api/ApiParameters.java index 448226c..16e78e8 100644 --- a/src/main/java/com/embedly/api/ApiParameters.java +++ b/src/main/java/com/embedly/api/ApiParameters.java @@ -6,6 +6,7 @@ import java.net.URLEncoder; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Map; import java.util.HashMap; @@ -56,10 +57,21 @@ public void push(String name, String value) { * @param values */ public void push(String name, String[] value) { - name = filterName(name); - ArrayList param = getParam(name); - param.addAll(Arrays.asList(value)); - } + this.push(name, Arrays.asList(value)); + } + + /** + * Add a collection of parameter values. + * + * @param name + * + * @param values + */ + public void push(String name, Collection value) { + name = filterName(name); + ArrayList param = getParam(name); + param.addAll(value); + } /** * Get an array of parameter values. Returns an empty From 307e0cf553a6c8247cd645e2934d17a9f648a61d Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:24:30 -0400 Subject: [PATCH 10/19] Adds example script --- build.gradle | 6 ++++++ .../groovy/com/embedly/examples/simple.groovy | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/test/groovy/com/embedly/examples/simple.groovy diff --git a/build.gradle b/build.gradle index b4141a0..8ebc413 100644 --- a/build.gradle +++ b/build.gradle @@ -59,6 +59,12 @@ task javadocJar(type: Jar, dependsOn: javadoc) { from javadoc.destinationDir } +task runSimple(dependsOn: [classes, testClasses], type: JavaExec) { + main = 'com.embedly.examples.Simple' + classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath +} + + artifacts { archives javadocJar archives sourcesJar diff --git a/src/test/groovy/com/embedly/examples/simple.groovy b/src/test/groovy/com/embedly/examples/simple.groovy new file mode 100644 index 0000000..a0fb08c --- /dev/null +++ b/src/test/groovy/com/embedly/examples/simple.groovy @@ -0,0 +1,18 @@ +package com.embedly.examples + +import com.embedly.api.Api +import org.apache.commons.logging.LogFactory + +class Simple { + static void main(args) { + Api.setLog(LogFactory.getLog(Api.class)) + def params = [ + urls: [ + 'http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos', + 'http://www.guardian.co.uk/media/2011/jan/21/andy-coulson-phone-hacking-statement' + ] + ] + def api = new Api('blah blah blah', System.getenv()['EMBEDLY_KEY']); + print api.oembed(params) + } +} From cea21f9b88f6f6828003802374be5450b4b683a1 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:54:09 -0400 Subject: [PATCH 11/19] Update to reflect new service offerings --- src/main/java/com/embedly/api/Api.java | 22 +++++++--------- src/test/features/objectify.feature | 2 +- src/test/features/oembed.feature | 35 ++++++++------------------ 3 files changed, 20 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index 4db61ba..4e9ff8d 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -58,7 +58,7 @@ public Api(String userAgent, String key) { * * @param userAgent A userAgent string containing contact information * - * @param key Your Embedly PRO key + * @param key Your Embedly key * * @param host An alternative hostname, used for debugging. * ex. "http://localhost" @@ -73,6 +73,12 @@ public Api(String userAgent, String key, String host) { "You must specify a userAgent when constructing an " + "Api object"); } + + if (this.key == null) { + throw new RuntimeException( + "You must specify a key when constructing an " + + "Api object"); + } if (this.host == null) { this.host = "http://api.embed.ly"; @@ -142,11 +148,6 @@ public JSONArray services() { // fail safe response resp = new JSONArray("[]"); - if (key != null) { - getLog().error("Pro doesn't support services"); - throw new RuntimeException("Pro doesn't support services"); - } - String call = this.host+"/1/services/javascript"; resp = new JSONArray(simpleHTTP(getHttpClient(), getResponseHandler(), call, getHeaders())); @@ -244,13 +245,8 @@ private JSONArray apicall(String version, String action, } ArrayList urls = query.getParam("urls"); - if (key != null) { - query.push("key", key); - urls = resp.prepare(urls, Pattern.compile(".*")); - } else { - getLog().debug("checking urls against services"); - urls = resp.prepare(urls, servicesPattern()); - } + query.push("key", key); + urls = resp.prepare(urls, Pattern.compile(".*")); if (urls.size() > 0) { String call = this.host+"/"+version+"/"+action+"?"+ diff --git a/src/test/features/objectify.feature b/src/test/features/objectify.feature index a56e212..91d3a72 100644 --- a/src/test/features/objectify.feature +++ b/src/test/features/objectify.feature @@ -4,7 +4,7 @@ Feature: Objectify I want to call the the embedly api Because I want to objectify a url - Scenario Outline: Get the meta description with pro + Scenario Outline: Get the meta description Given an embedly host with key When objectify is called with the URL Then the meta.description should start with diff --git a/src/test/features/oembed.feature b/src/test/features/oembed.feature index 6f4a1b6..198913e 100644 --- a/src/test/features/oembed.feature +++ b/src/test/features/oembed.feature @@ -5,7 +5,7 @@ Feature: OEmbed Because I want and oembed for a specific url Scenario Outline: Get the provider_url - Given an embedly host + Given an embedly host with key When oembed is called with the URL Then the provider_url should be @@ -18,7 +18,7 @@ Feature: OEmbed Scenario Outline: Get the types - Given an embedly host + Given an embedly host with key When oembed is called with the URL Then the type should be @@ -31,7 +31,7 @@ Feature: OEmbed Scenario Outline: Get the provider_url with force flag - Given an embedly host + Given an embedly host with key When oembed is called with the URL and force flag Then the provider_url should be @@ -41,7 +41,7 @@ Feature: OEmbed Scenario Outline: Get multiple provider_urls - Given an embedly host + Given an embedly host with key When oembed is called with the URLs Then provider_url should be @@ -51,7 +51,7 @@ Feature: OEmbed | http://www.youtube.com/watch?v=Zk7dDekYej0,http://yfrog.com/h855mugj | http://www.youtube.com/,http://yfrog.com | - Scenario Outline: Get the provider_url with pro + Scenario Outline: Get the provider_url Given an embedly host with key When oembed is called with the URL Then the provider_url should be @@ -64,7 +64,7 @@ Feature: OEmbed Scenario Outline: Attempt to get 404 URL - Given an embedly host + Given an embedly host with key When oembed is called with the URL Then type should be error And error_code should be 404 @@ -73,12 +73,11 @@ Feature: OEmbed Examples: | url | | http://www.youtube.com/watch/is/a/bad/url | - | http://www.scribd.com/doc/zfldsf/asdfkljlas/klajsdlfkasdf | | http://fav.me/alsfsdf | Scenario Outline: Attempt multi get 404 URLs - Given an embedly host + Given an embedly host with key When oembed is called with the URLs Then error_code should be And type should be @@ -86,21 +85,7 @@ Feature: OEmbed Examples: | urls | errcode | types | | http://www.youtube.com/watch/a/bassd/url,http://www.youtube.com/watch/ldf/asdlfj | 404,404 | error,error | - | http://www.scribd.com/doc/lsbsdlfldsf/kl,http://www.scribd.com/doc/zasdf/asdfl | 404,404 | error,error | - | http://www.youtube.com/watch/zzzzasdf/kl,http://yfrog.com/h855mugj | 404, | error,photo | - | http://yfrog.com/h855mugj,http://www.scribd.com/doc/asdfasdfasdf | ,404 | photo,error | + | http://www.youtube.com/watch/ldf/asdlfj,http://yfrog.com/h855mugj | 404, | error,photo | + | http://yfrog.com/h855mugj,http://www.youtube.com/watch/ldf/asdlfj | ,404 | photo,error | - Scenario Outline: Attempt at non-api service without key - Given an embedly host - When oembed is called with the URL - Then error_code should be 401 - And error_message should be This service requires an Embedly Pro account - And type should be error - - Examples: - | url | - | http://hn.embed.ly/ | - | http://bit.ly/enZRxO | - | http://techcrunch.com/2011/02/03/linkedins-next-data-dive-professional-skills/ | - | http://teachertube.com/rssPhoto.php | - | http://goo.gl/y1i9p | + \ No newline at end of file From 4b3c6ff159c971ed2129829204e2618cd994a89a Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 13:54:26 -0400 Subject: [PATCH 12/19] version bump --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8ebc413..8e6fb07 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'eclipse' apply plugin:com.smokejumperit.gradle.CukePlugin apply plugin:de.huxhorn.gradle.pgp.PgpPlugin -version = '0.1.3-SNAPSHOT' +version = '0.1.3' configurations { runtime.exclude module: 'groovy' From 5ad78fd31db95364ab85fa9efe1c62ef68ad39b5 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 14:03:06 -0400 Subject: [PATCH 13/19] Make it easier for me to remember how to release --- README.markdown | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 759aa10..499dd39 100644 --- a/README.markdown +++ b/README.markdown @@ -74,10 +74,15 @@ If you would like cutting edge, then you can clone and install HEAD. ## Release - Add -Drelease=true -Dsign=true to gradle command line. Be sure - gradle.settings has the appropriate settings and that version is + Add -Drelease=true -Dsign=true to gradle command line. + + $ gradle -Drelease=true -Dsign=true uploadArchives + + Be sure gradle.settings has the appropriate settings and that version is not SNAPSHOT. + If you are a maintainer, then you can log in to oss.sonatype.org and release. + ## Note on Patches/Pull Requests * Fork the project. From da33e7f8610d9a6e34f18b962aa0d948e7c2e04e Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 14:03:57 -0400 Subject: [PATCH 14/19] Bump version --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 499dd39..4ca8e10 100644 --- a/README.markdown +++ b/README.markdown @@ -11,7 +11,7 @@ We keep the latest release on MavenCentral. com.embedly embedly-api - 0.1.2 + 0.1.3 If you would like cutting edge, then you can clone and install HEAD. From e164c58d681275aef4642ed72399054af1b96903 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 18 Aug 2011 14:06:14 -0400 Subject: [PATCH 15/19] Bumps version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8e6fb07..ec927b5 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'eclipse' apply plugin:com.smokejumperit.gradle.CukePlugin apply plugin:de.huxhorn.gradle.pgp.PgpPlugin -version = '0.1.3' +version = '0.1.4-SNAPSHOT' configurations { runtime.exclude module: 'groovy' From e923ac07ba7cea3dd619207ba527dbf33b9bf5bb Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 4 Apr 2013 09:46:59 -0400 Subject: [PATCH 16/19] Add extract --- build.gradle | 3 ++- src/main/java/com/embedly/api/Api.java | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index ec927b5..69c7e30 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,8 @@ buildscript { mavenRepo urls:'http://repo.smokejumperit.com' } dependencies { - classpath 'com.smokejumperit:gradle-plugins:0.7.1-SNAPSHOT' + classpath 'com.smokejumperit:gradle-plugins:0.8.2' + classpath 'org.yaml:snakeyaml:1.12' classpath 'de.huxhorn.gradle:de.huxhorn.gradle.pgp-plugin:0.0.3' } } diff --git a/src/main/java/com/embedly/api/Api.java b/src/main/java/com/embedly/api/Api.java index 4e9ff8d..e198195 100644 --- a/src/main/java/com/embedly/api/Api.java +++ b/src/main/java/com/embedly/api/Api.java @@ -43,10 +43,9 @@ public Api(String userAgent, String key) { /** * The Api object is used to access both Embedly API - * and Embedly Pro. When a key is used, the Pro endpoints - * oembed, preview and objectify are available. When no - * key is used, the API endpoints services and oembed are - * available. + * and Embedly Pro. When a key is used, the Pro endpoints oembed, extract, + * preview and objectify are available. When no key is used, the API + * endpoints services and oembed are available. * * A userAgent containing, at the very least, a contact * email address for the client applications operator. This @@ -104,6 +103,21 @@ public JSONArray oembed(Map params) { return this.apicall("1", "oembed", params); } + /** + * Call the extract endpoint. + * + * Embedly Extract Docs + * + * @param params A map of name value pairs. The value should be either + * a String, or a String[]. At this time, String[] is only + * valid for the "urls" parameter. + * + * @return JSONArray of JSONObjects. + */ + public JSONArray extract(Map params) { + return this.apicall("1", "extract", params); + } + /** * Call the objectify endpoint. Valid for Pro instances. * @@ -205,8 +219,8 @@ public String toString() { /** * Generic Embedly endpoint call. This shouldn't be called directly, but - * is used internally by the oembed, objectify and preview endpoint - * methods. + * is used internally by the oembed, extract, objectify and preview + * endpoint methods. * * Embedly Docs * From 1b02d3b13ea3c7e0bfbdd5b9695e09e886525b5c Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 4 Apr 2013 14:30:39 -0400 Subject: [PATCH 17/19] Didn't need it anyway --- .rvmrc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .rvmrc diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 57d7c97..0000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm jruby-1.5.6@embedly-java From c3c4b95f65c81ff62251a2ba6a097702d3789861 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Thu, 4 Apr 2013 14:59:19 -0400 Subject: [PATCH 18/19] Releases 1.5 --- .gitignore | 2 ++ build.gradle | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index dd71e51..e2a275b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ bin .settings .project gradle.properties +.ruby-version +.ruby-gemset diff --git a/build.gradle b/build.gradle index 69c7e30..18bd1bb 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'eclipse' apply plugin:com.smokejumperit.gradle.CukePlugin apply plugin:de.huxhorn.gradle.pgp.PgpPlugin -version = '0.1.4-SNAPSHOT' +version = '0.1.5-SNAPSHOT' configurations { runtime.exclude module: 'groovy' From 2eb3883c120e90b58f3b48fe7267532f969c2597 Mon Sep 17 00:00:00 2001 From: Bob Corsaro Date: Mon, 8 Jun 2015 09:54:57 -0400 Subject: [PATCH 19/19] Update README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 4ca8e10..477f526 100644 --- a/README.markdown +++ b/README.markdown @@ -11,7 +11,7 @@ We keep the latest release on MavenCentral. com.embedly embedly-api - 0.1.3 + 0.1.5 If you would like cutting edge, then you can clone and install HEAD.