From e53278440c2655f270d946e4da0395db45286bd1 Mon Sep 17 00:00:00 2001 From: Shawn Tan Date: Thu, 25 Jul 2013 14:44:46 +0800 Subject: [PATCH 001/102] Removed example code. --- src/Example.java | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/Example.java diff --git a/src/Example.java b/src/Example.java deleted file mode 100644 index a2fd087..0000000 --- a/src/Example.java +++ /dev/null @@ -1,36 +0,0 @@ -import java.io.IOException; - -import oauth.signpost.exception.OAuthCommunicationException; -import oauth.signpost.exception.OAuthExpectationFailedException; -import oauth.signpost.exception.OAuthMessageSignerException; - -import org.json.JSONObject; - -import com.semantics3.api.Products; - -public class Example { - - /** - * @param args - */ - public static void main(String args[]) { - - try { - Products products = new Products( - "", - "" - ); - products - .field( "cat_id", 4992 ) - .field( "brand", "Toshiba" ); - JSONObject results; - results = products.get(); - System.out.println(results.toString(4)); - } catch (OAuthMessageSignerException | OAuthExpectationFailedException - | OAuthCommunicationException | IOException e) { - e.printStackTrace(); - } - - } - -} From 0e88aaf23237a89554113696dcdec49929f6d27b Mon Sep 17 00:00:00 2001 From: Shawn Tan Date: Thu, 25 Jul 2013 15:30:11 +0800 Subject: [PATCH 002/102] Included links to dependencies. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index edfeae5..0092514 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ semantics3-java is a Java client for accessing the Semantics3 Products API, whic See https://www.semantics3.com for more information. ## Requirements -* signpost-core-1.2.1.2.jar - OAuth2 implementation -* commons-codec-1.7.jar - Apache Commons Codec library for Base64 implementation +* [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation + +* [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation ## Getting Started From c223bc67432076995924134651f260e575c56254 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Wed, 7 Jan 2015 17:36:45 +0530 Subject: [PATCH 003/102] Partially edited --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0092514..bfea94c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# semantics3 +# semantics3-java semantics3-java is a Java client for accessing the Semantics3 Products API, which provides structured information, including pricing histories, for a large number of products. See https://www.semantics3.com for more information. @@ -46,9 +46,9 @@ results = products.get(); System.out.println(results); ``` -## Examples +## Sample Queries -The following examples show you how to interface with some of the core functionality of the Semantics3 Products API. For more detailed examples check out the Quickstart guide: https://www.semantics3.com/quickstart +The following queries show you how to interface with some of the core functionality of the Semantics3 Products API: ### Explore the Category Tree From 0866784b8c717dc11213a15be1cae433d6402b18 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Wed, 7 Jan 2015 20:29:47 +0530 Subject: [PATCH 004/102] Partially edited --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfea94c..2c285f4 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ System.out.println(results); ## Sample Queries -The following queries show you how to interface with some of the core functionality of the Semantics3 Products API: +The following queries show you how to interface with some of the core functionality of the Semantics3 Products API : ### Explore the Category Tree From 397f90779d1e219e6377efa8312bcb50f257361a Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 14:50:06 +0530 Subject: [PATCH 005/102] Partially committed --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2c285f4..26db9b1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ semantics3-java is a Java client for accessing the Semantics3 Products API, which provides structured information, including pricing histories, for a large number of products. See https://www.semantics3.com for more information. +## Installation +* The JAVA version used for this library is JDK 8. + +* To build and install from the latest source: + +```git clone git@github.com:Semantics3/semantics3-java.git``` + ## Requirements * [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation From 5b98c55625e842fb7906b04bde0b9b96ba97935a Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 15:20:01 +0530 Subject: [PATCH 006/102] Partially committed --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 26db9b1..07fa75d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ semantics3-java is a Java client for accessing the Semantics3 Products API, whic See https://www.semantics3.com for more information. ## Installation -* The JAVA version used for this library is JDK 8. +* The JAVA version used for this library is JDK 7. * To build and install from the latest source: @@ -14,6 +14,8 @@ See https://www.semantics3.com for more information. * [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation +* JDK >= 6 + ## Getting Started In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at @@ -34,9 +36,9 @@ Products products = new Products( ); ``` -### First Query aka 'Hello World': +### First Request aka 'Hello World': -Let's make our first query! For this query, we are going to search for all Toshiba products that fall under the category of "Computers and Accessories", whose cat_id is 4992. +Let's make our first Request! For this Request, we are going to search for all Toshiba products that fall under the category of "Computers and Accessories", whose cat_id is 4992. ```java /* Build the query */ @@ -53,9 +55,9 @@ results = products.get(); System.out.println(results); ``` -## Sample Queries +## Sample Requests -The following queries show you how to interface with some of the core functionality of the Semantics3 Products API : +The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : ### Explore the Category Tree From dd317c53a121794f950e72dd93ebc1c06f0437b8 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 15:41:50 +0530 Subject: [PATCH 007/102] Partially committed --- README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 07fa75d..34a5ff1 100644 --- a/README.md +++ b/README.md @@ -41,17 +41,17 @@ Products products = new Products( Let's make our first Request! For this Request, we are going to search for all Toshiba products that fall under the category of "Computers and Accessories", whose cat_id is 4992. ```java -/* Build the query */ +/* Build the Request */ products .productsField( "cat_id", 4992 ) .productsField( "brand", "Toshiba" ); -/* Make the query */ +/* Make the Request */ JSONObject results = products.getProducts(); /* or */ results = products.get(); -/* View the results of the query */ +/* View the results of the Request */ System.out.println(results); ``` @@ -59,6 +59,26 @@ System.out.println(results); The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : + ### UPC Request + + ```java +/* Build the Request */ +products + .field( "upc", "883974958450" ) + .field( "field", "name","gtins" ); + +/* Make the Request */ +JSONObject results = products.getProducts(); +/* or */ +results = products.get(); + +/* View the results of the Request */ +System.out.println(results); +``` + + + + ### Explore the Category Tree In this example we are going to be accessing the categories endpoint. We are going to be specifically exploiring the "Computers and Accessories" category, which has a cat_id of 4992. For more details regarding our category tree and associated cat_ids check out our API docs at https://www.semantics3.com/docs From 10de0e386c0cba09176007892272076118141d02 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 15:46:32 +0530 Subject: [PATCH 008/102] Partially committed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34a5ff1..fb8c254 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ System.out.println(results); The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : - ### UPC Request +### UPC Request ```java /* Build the Request */ From 65dd1edeb5385ef3706b55c0a060a1f1ffd8bb0a Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 15:48:30 +0530 Subject: [PATCH 009/102] Partially committed --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fb8c254..a889664 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ The following Requests show you how to interface with some of the core functiona ### UPC Request +Running a UPC/EAN/GTIN request is as simple as running a search request: + ```java /* Build the Request */ products From c22157102257e67010efb5259b336ef1fe9554af Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 16:07:38 +0530 Subject: [PATCH 010/102] Partially committed --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a889664..481db06 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ Running a UPC/EAN/GTIN request is as simple as running a search request: ```java /* Build the Request */ products - .field( "upc", "883974958450" ) - .field( "field", "name","gtins" ); + .productsField( "upc", "883974958450" ) + .productsField( "field", "name","gtins" ); /* Make the Request */ JSONObject results = products.getProducts(); @@ -78,7 +78,18 @@ results = products.get(); System.out.println(results); ``` - +### URL Query + +Get the picture? You can run URL queries as follows: + +```java +products + .productsField( "url", "http://www.walmart.com/ip/15833173" ); +JSONObject results = products.getProducts(); +results = products.get(); +System.out.println(results); +``` + ### Explore the Category Tree From f563c198b1230262a7d4bde2f454bafeddc24d03 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 16:20:07 +0530 Subject: [PATCH 011/102] Partially committed --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 481db06..3d1e99e 100644 --- a/README.md +++ b/README.md @@ -78,16 +78,29 @@ results = products.get(); System.out.println(results); ``` -### URL Query +### URL Request -Get the picture? You can run URL queries as follows: +Get the picture? You can run URL Requests as follows: ```java products .productsField( "url", "http://www.walmart.com/ip/15833173" ); -JSONObject results = products.getProducts(); -results = products.get(); -System.out.println(results); + JSONObject results = products.getProducts(); + results = products.get(); + System.out.println(results); +``` + +### Price Filter + +Filter by price using the "lt" (less than) tag: + +```java +products + .productsField( "search", "iphone" ) + .productsField( "price", "lt", 300 ); + JSONObject results = products.getProducts(); + results = products.get(); + System.out.println(results); ``` From 8bba4357d5bf04b0febc8e1258b88a2eebcc7289 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 16:46:39 +0530 Subject: [PATCH 012/102] Partially committed --- README.md | 80 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 3d1e99e..4d14f71 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ Get the picture? You can run URL Requests as follows: products .productsField( "url", "http://www.walmart.com/ip/15833173" ); JSONObject results = products.getProducts(); - results = products.get(); System.out.println(results); ``` @@ -99,92 +98,25 @@ products .productsField( "search", "iphone" ) .productsField( "price", "lt", 300 ); JSONObject results = products.getProducts(); - results = products.get(); System.out.println(results); ``` +### Category ID Query - -### Explore the Category Tree - -In this example we are going to be accessing the categories endpoint. We are going to be specifically exploiring the "Computers and Accessories" category, which has a cat_id of 4992. For more details regarding our category tree and associated cat_ids check out our API docs at https://www.semantics3.com/docs - -```java -/* Build the query */ -products.categoriesField( "cat_id", 4992 ); - -/* Execute the query */ -JSONObject results = products.getCategories(); - -/* View the results of the query */ -System.out.println(results); -``` - -### Nested Search Query - -You can intuitively construct all your complex queries but just repeatedly using the products_field() or add() methods. -Here is how we translate the following JSON query: - -```javascript -{ - "cat_id" : 4992, - "brand" : "Toshiba", - "weight" : { "gte":1000000, "lt":1500000 }, - "sitedetails" : { - "name" : "newegg.com", - "latestoffers" : { - "currency": "USD", - "price" : { "gte" : 100 } - } - } -} -``` - - -This query returns all Toshiba products within a certain weight range narrowed down to just those that retailed recently on newegg.com for >= USD 100. +To lookup details about a cat_id, run your request against the categories resource: ```java /* Build the query */ -Products products = new Products( api_key, api_secret ); products - .field("cat_id", 4992) - .field("brand", "Toshiba") - .field("weight", "gte", 1000000) - .field("weight", "lt", 1500000) - .siteDetails("name","newegg.com") - .latestOffers("currency","USD") - .latestOffers("price","gte",100); - -/* Let's make a modification - say we no longer want the weight attribute */ -products.remove( "products", "weight" ); - -/* Make the query */ -JSONObject results = products.getProducts(); -System.out.println(results); -``` - - - -### Explore Price Histories -For this example, we are going to look at a particular product that is sold by select merchants and has a price of >= USD 30 and seen after a specific date (specified as a UNIX timestamp). + .categoriesField( "cat_id", 4992 ); -```java -/* Build the query */ -products.offersField("sem3_id", "4znupRCkN6w2Q4Ke4s6sUC"); -products.offersField("seller", new String[] { "LFleurs","Frys","Walmart" }); -products.offersField("currency", "USD"); -products.offersField("price", "gte", 30); -products.offersField("lastrecorded_at", "gte", 1348654600); - -/* Make the query */ -JSONObject results = products.getOffers() +/* Execute the query */ + JSONObject results = products.getCategories(); /* View the results of the query */ -System.out.println(results) + System.out.println(results); ``` - - ## Contributing Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . From f29718ab81dc57235640b4bb340e5e8d5927c8be Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 16:48:45 +0530 Subject: [PATCH 013/102] Partially committed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d14f71..4b542e6 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ products System.out.println(results); ``` -### Category ID Query +### Category ID Request To lookup details about a cat_id, run your request against the categories resource: From 1b89c286816be59f78463139596b556340f65ae6 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 17:00:42 +0530 Subject: [PATCH 014/102] Partially committed --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b542e6..5e1ed82 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,7 @@ Let's make our first Request! For this Request, we are going to search for all T ```java /* Build the Request */ products - .productsField( "cat_id", 4992 ) - .productsField( "brand", "Toshiba" ); + .productsField( "search", "iphone" ); /* Make the Request */ JSONObject results = products.getProducts(); @@ -59,7 +58,7 @@ System.out.println(results); The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : -### UPC Request +### UPC Query Running a UPC/EAN/GTIN request is as simple as running a search request: @@ -78,7 +77,7 @@ results = products.get(); System.out.println(results); ``` -### URL Request +### URL Query Get the picture? You can run URL Requests as follows: @@ -101,7 +100,7 @@ products System.out.println(results); ``` -### Category ID Request +### Category ID Query To lookup details about a cat_id, run your request against the categories resource: From fc4aad8868b7a80e3e1213330cc3e05c10ae4945 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 17:02:45 +0530 Subject: [PATCH 015/102] Partially committed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e1ed82..d6ee414 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Products products = new Products( ### First Request aka 'Hello World': -Let's make our first Request! For this Request, we are going to search for all Toshiba products that fall under the category of "Computers and Accessories", whose cat_id is 4992. +Let's make our first Request! We are going to run a simple search fo the word "iPhone" as follows: ```java /* Build the Request */ From 6109a811ae9f552df14366235fdd1b688582098a Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Thu, 8 Jan 2015 17:56:23 +0530 Subject: [PATCH 016/102] Partially committed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6ee414..97ff824 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Running a UPC/EAN/GTIN request is as simple as running a search request: /* Build the Request */ products .productsField( "upc", "883974958450" ) - .productsField( "field", "name","gtins" ); + .productsField( "fields", "name","gtins" ); /* Make the Request */ JSONObject results = products.getProducts(); From 7151a5ce380b046dc758bc8fb506d4afae490c46 Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Wed, 7 Jan 2015 20:29:47 +0530 Subject: [PATCH 017/102] Added Author Name --- README.md | 120 ++++++++++++++++++++++++------------------------------ 1 file changed, 53 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index bfea94c..deefa20 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,20 @@ semantics3-java is a Java client for accessing the Semantics3 Products API, which provides structured information, including pricing histories, for a large number of products. See https://www.semantics3.com for more information. +## Installation +* The JAVA version used for this library is JDK 7. + +* To build and install from the latest source: + +```git clone git@github.com:Semantics3/semantics3-java.git``` + ## Requirements * [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation * [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation +* JDK >= 6 + ## Getting Started In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at @@ -27,119 +36,96 @@ Products products = new Products( ); ``` -### First Query aka 'Hello World': +### First Request aka 'Hello World': -Let's make our first query! For this query, we are going to search for all Toshiba products that fall under the category of "Computers and Accessories", whose cat_id is 4992. +Let's make our first Request! We are going to run a simple search fo the word "iPhone" as follows: ```java -/* Build the query */ +/* Build the Request */ products - .productsField( "cat_id", 4992 ) - .productsField( "brand", "Toshiba" ); + .productsField( "search", "iphone" ); -/* Make the query */ +/* Make the Request */ JSONObject results = products.getProducts(); /* or */ results = products.get(); -/* View the results of the query */ +/* View the results of the Request */ System.out.println(results); ``` -## Sample Queries +## Sample Requests -The following queries show you how to interface with some of the core functionality of the Semantics3 Products API: +The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : -### Explore the Category Tree +### UPC Query -In this example we are going to be accessing the categories endpoint. We are going to be specifically exploiring the "Computers and Accessories" category, which has a cat_id of 4992. For more details regarding our category tree and associated cat_ids check out our API docs at https://www.semantics3.com/docs +Running a UPC/EAN/GTIN request is as simple as running a search request: -```java -/* Build the query */ -products.categoriesField( "cat_id", 4992 ); + ```java +/* Build the Request */ +products + .productsField( "upc", "883974958450" ) + .productsField( "fields", "name","gtins" ); -/* Execute the query */ -JSONObject results = products.getCategories(); +/* Make the Request */ +JSONObject results = products.getProducts(); +/* or */ +results = products.get(); -/* View the results of the query */ +/* View the results of the Request */ System.out.println(results); ``` -### Nested Search Query - -You can intuitively construct all your complex queries but just repeatedly using the products_field() or add() methods. -Here is how we translate the following JSON query: - -```javascript -{ - "cat_id" : 4992, - "brand" : "Toshiba", - "weight" : { "gte":1000000, "lt":1500000 }, - "sitedetails" : { - "name" : "newegg.com", - "latestoffers" : { - "currency": "USD", - "price" : { "gte" : 100 } - } - } -} +### URL Query + +Get the picture? You can run URL Requests as follows: + +```java +products + .productsField( "url", "http://www.walmart.com/ip/15833173" ); + JSONObject results = products.getProducts(); + System.out.println(results); ``` +### Price Filter -This query returns all Toshiba products within a certain weight range narrowed down to just those that retailed recently on newegg.com for >= USD 100. +Filter by price using the "lt" (less than) tag: ```java -/* Build the query */ -Products products = new Products( api_key, api_secret ); products - .field("cat_id", 4992) - .field("brand", "Toshiba") - .field("weight", "gte", 1000000) - .field("weight", "lt", 1500000) - .siteDetails("name","newegg.com") - .latestOffers("currency","USD") - .latestOffers("price","gte",100); - -/* Let's make a modification - say we no longer want the weight attribute */ -products.remove( "products", "weight" ); - -/* Make the query */ -JSONObject results = products.getProducts(); -System.out.println(results); + .productsField( "search", "iphone" ) + .productsField( "price", "lt", 300 ); + JSONObject results = products.getProducts(); + System.out.println(results); ``` +### Category ID Query - -### Explore Price Histories -For this example, we are going to look at a particular product that is sold by select merchants and has a price of >= USD 30 and seen after a specific date (specified as a UNIX timestamp). +To lookup details about a cat_id, run your request against the categories resource: ```java /* Build the query */ -products.offersField("sem3_id", "4znupRCkN6w2Q4Ke4s6sUC"); -products.offersField("seller", new String[] { "LFleurs","Frys","Walmart" }); -products.offersField("currency", "USD"); -products.offersField("price", "gte", 30); -products.offersField("lastrecorded_at", "gte", 1348654600); +products + .categoriesField( "cat_id", 4992 ); -/* Make the query */ -JSONObject results = products.getOffers() +/* Execute the query */ + JSONObject results = products.getCategories(); /* View the results of the query */ -System.out.println(results) + System.out.println(results); ``` - - ## Contributing Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . ## Author -* Shawn Tan +* Asmit Kumar ## Copyright -Copyright (c) 2013 Semantics3 Inc. +Copyright (c) 2015 Semantics3 Inc. ## License From aea128ed3d33c4a177af03531a0bb4c247a7812b Mon Sep 17 00:00:00 2001 From: Your Name Here Date: Mon, 12 Jan 2015 15:23:48 +0530 Subject: [PATCH 018/102] Added previous author name including the current one --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index deefa20..1d11522 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,9 @@ products ## Contributing Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . -## Author +## Authors + +* Shawn Tan * Asmit Kumar From c09255d1b9d0a12b21a41368d581d401242a8e89 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 1 Apr 2015 19:09:38 +0530 Subject: [PATCH 019/102] Add as a Maven Project --- .gitignore | 11 -- README.md | 154 ------------------ pom.xml | 33 ++++ src/{ => main/java}/com/semantics3/Util.java | 0 .../java}/com/semantics3/api/Categories.java | 0 .../java}/com/semantics3/api/Offers.java | 0 .../java}/com/semantics3/api/Products.java | 0 .../com/semantics3/api/Semantics3Request.java | 17 +- .../errors/Semantics3Exception.java | 0 src/{ => main/java}/org/json/CDL.java | 0 src/{ => main/java}/org/json/Cookie.java | 0 src/{ => main/java}/org/json/CookieList.java | 0 src/{ => main/java}/org/json/HTTP.java | 0 src/{ => main/java}/org/json/HTTPTokener.java | 0 src/{ => main/java}/org/json/JSONArray.java | 0 .../java}/org/json/JSONException.java | 0 src/{ => main/java}/org/json/JSONML.java | 0 src/{ => main/java}/org/json/JSONObject.java | 0 src/{ => main/java}/org/json/JSONString.java | 0 .../java}/org/json/JSONStringer.java | 0 src/{ => main/java}/org/json/JSONTokener.java | 0 src/{ => main/java}/org/json/JSONWriter.java | 0 src/{ => main/java}/org/json/None.java | 0 src/{ => main/java}/org/json/XML.java | 0 src/{ => main/java}/org/json/XMLTokener.java | 0 25 files changed, 41 insertions(+), 174 deletions(-) delete mode 100644 .gitignore delete mode 100644 README.md create mode 100644 pom.xml rename src/{ => main/java}/com/semantics3/Util.java (100%) rename src/{ => main/java}/com/semantics3/api/Categories.java (100%) rename src/{ => main/java}/com/semantics3/api/Offers.java (100%) rename src/{ => main/java}/com/semantics3/api/Products.java (100%) rename src/{ => main/java}/com/semantics3/api/Semantics3Request.java (99%) rename src/{ => main/java}/com/semantics3/errors/Semantics3Exception.java (100%) rename src/{ => main/java}/org/json/CDL.java (100%) rename src/{ => main/java}/org/json/Cookie.java (100%) rename src/{ => main/java}/org/json/CookieList.java (100%) rename src/{ => main/java}/org/json/HTTP.java (100%) rename src/{ => main/java}/org/json/HTTPTokener.java (100%) rename src/{ => main/java}/org/json/JSONArray.java (100%) rename src/{ => main/java}/org/json/JSONException.java (100%) rename src/{ => main/java}/org/json/JSONML.java (100%) rename src/{ => main/java}/org/json/JSONObject.java (100%) rename src/{ => main/java}/org/json/JSONString.java (100%) rename src/{ => main/java}/org/json/JSONStringer.java (100%) rename src/{ => main/java}/org/json/JSONTokener.java (100%) rename src/{ => main/java}/org/json/JSONWriter.java (100%) rename src/{ => main/java}/org/json/None.java (100%) rename src/{ => main/java}/org/json/XML.java (100%) rename src/{ => main/java}/org/json/XMLTokener.java (100%) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ba13d11..0000000 --- a/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -*~ -.* -bin -!.gitignore -*.class - -# Package Files # -*.jar -*.war -*.ear -Main.java diff --git a/README.md b/README.md deleted file mode 100644 index 1d11522..0000000 --- a/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# semantics3-java -semantics3-java is a Java client for accessing the Semantics3 Products API, which provides structured information, including pricing histories, for a large number of products. -See https://www.semantics3.com for more information. - -## Installation -* The JAVA version used for this library is JDK 7. - -* To build and install from the latest source: - -```git clone git@github.com:Semantics3/semantics3-java.git``` - -## Requirements -* [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation - -* [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation - -* JDK >= 6 - -## Getting Started - -In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at -https://www.semantics3.com/ -You can access your API access credentials from the user dashboard at https://www.semantics3.com/dashboard/applications - -### Setup Work - -Let's lay the groundwork. - -```java -import com.semantics3.api.Products; - -/* Set up a client to talk to the Semantics3 API using your Semantics3 API Credentials */ -Products products = new Products( - "SEM3xxxxxxxxxxxxxxxxxxxxxx", - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -); -``` - -### First Request aka 'Hello World': - -Let's make our first Request! We are going to run a simple search fo the word "iPhone" as follows: - -```java -/* Build the Request */ -products - .productsField( "search", "iphone" ); - -/* Make the Request */ -JSONObject results = products.getProducts(); -/* or */ -results = products.get(); - -/* View the results of the Request */ -System.out.println(results); -``` - -## Sample Requests - -The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : - -### UPC Query - -Running a UPC/EAN/GTIN request is as simple as running a search request: - - ```java -/* Build the Request */ -products - .productsField( "upc", "883974958450" ) - .productsField( "fields", "name","gtins" ); - -/* Make the Request */ -JSONObject results = products.getProducts(); -/* or */ -results = products.get(); - -/* View the results of the Request */ -System.out.println(results); -``` - -### URL Query - -Get the picture? You can run URL Requests as follows: - -```java -products - .productsField( "url", "http://www.walmart.com/ip/15833173" ); - JSONObject results = products.getProducts(); - System.out.println(results); -``` - -### Price Filter - -Filter by price using the "lt" (less than) tag: - -```java -products - .productsField( "search", "iphone" ) - .productsField( "price", "lt", 300 ); - JSONObject results = products.getProducts(); - System.out.println(results); -``` - -### Category ID Query - -To lookup details about a cat_id, run your request against the categories resource: - -```java -/* Build the query */ -products - .categoriesField( "cat_id", 4992 ); - -/* Execute the query */ - JSONObject results = products.getCategories(); - -/* View the results of the query */ - System.out.println(results); -``` - -## Contributing -Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . - -## Authors - -* Shawn Tan - -* Asmit Kumar - -## Copyright - -Copyright (c) 2015 Semantics3 Inc. - -## License - - The "MIT" License - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9bb6530 --- /dev/null +++ b/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + Sem3Java + Sem3Java + 1.0-SNAPSHOT + Semantics3 Java Library + http://maven.apache.org + + + junit + junit + 4.11 + test + + + oauth.signpost + signpost-core + 1.2 + compile + + + commons-codec + commons-codec + 1.10 + + + + + \ No newline at end of file diff --git a/src/com/semantics3/Util.java b/src/main/java/com/semantics3/Util.java similarity index 100% rename from src/com/semantics3/Util.java rename to src/main/java/com/semantics3/Util.java diff --git a/src/com/semantics3/api/Categories.java b/src/main/java/com/semantics3/api/Categories.java similarity index 100% rename from src/com/semantics3/api/Categories.java rename to src/main/java/com/semantics3/api/Categories.java diff --git a/src/com/semantics3/api/Offers.java b/src/main/java/com/semantics3/api/Offers.java similarity index 100% rename from src/com/semantics3/api/Offers.java rename to src/main/java/com/semantics3/api/Offers.java diff --git a/src/com/semantics3/api/Products.java b/src/main/java/com/semantics3/api/Products.java similarity index 100% rename from src/com/semantics3/api/Products.java rename to src/main/java/com/semantics3/api/Products.java diff --git a/src/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java similarity index 99% rename from src/com/semantics3/api/Semantics3Request.java rename to src/main/java/com/semantics3/api/Semantics3Request.java index 369c1bb..68fcc3f 100644 --- a/src/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -1,20 +1,19 @@ package com.semantics3.api; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.util.HashMap; -import org.json.JSONObject; -import org.json.JSONTokener; - import com.semantics3.errors.Semantics3Exception; - import oauth.signpost.OAuthConsumer; import oauth.signpost.basic.DefaultOAuthConsumer; import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; +import org.json.JSONObject; +import org.json.JSONTokener; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.util.HashMap; public class Semantics3Request{ final static private String API_DOMAIN = "api.semantics3.com"; diff --git a/src/com/semantics3/errors/Semantics3Exception.java b/src/main/java/com/semantics3/errors/Semantics3Exception.java similarity index 100% rename from src/com/semantics3/errors/Semantics3Exception.java rename to src/main/java/com/semantics3/errors/Semantics3Exception.java diff --git a/src/org/json/CDL.java b/src/main/java/org/json/CDL.java similarity index 100% rename from src/org/json/CDL.java rename to src/main/java/org/json/CDL.java diff --git a/src/org/json/Cookie.java b/src/main/java/org/json/Cookie.java similarity index 100% rename from src/org/json/Cookie.java rename to src/main/java/org/json/Cookie.java diff --git a/src/org/json/CookieList.java b/src/main/java/org/json/CookieList.java similarity index 100% rename from src/org/json/CookieList.java rename to src/main/java/org/json/CookieList.java diff --git a/src/org/json/HTTP.java b/src/main/java/org/json/HTTP.java similarity index 100% rename from src/org/json/HTTP.java rename to src/main/java/org/json/HTTP.java diff --git a/src/org/json/HTTPTokener.java b/src/main/java/org/json/HTTPTokener.java similarity index 100% rename from src/org/json/HTTPTokener.java rename to src/main/java/org/json/HTTPTokener.java diff --git a/src/org/json/JSONArray.java b/src/main/java/org/json/JSONArray.java similarity index 100% rename from src/org/json/JSONArray.java rename to src/main/java/org/json/JSONArray.java diff --git a/src/org/json/JSONException.java b/src/main/java/org/json/JSONException.java similarity index 100% rename from src/org/json/JSONException.java rename to src/main/java/org/json/JSONException.java diff --git a/src/org/json/JSONML.java b/src/main/java/org/json/JSONML.java similarity index 100% rename from src/org/json/JSONML.java rename to src/main/java/org/json/JSONML.java diff --git a/src/org/json/JSONObject.java b/src/main/java/org/json/JSONObject.java similarity index 100% rename from src/org/json/JSONObject.java rename to src/main/java/org/json/JSONObject.java diff --git a/src/org/json/JSONString.java b/src/main/java/org/json/JSONString.java similarity index 100% rename from src/org/json/JSONString.java rename to src/main/java/org/json/JSONString.java diff --git a/src/org/json/JSONStringer.java b/src/main/java/org/json/JSONStringer.java similarity index 100% rename from src/org/json/JSONStringer.java rename to src/main/java/org/json/JSONStringer.java diff --git a/src/org/json/JSONTokener.java b/src/main/java/org/json/JSONTokener.java similarity index 100% rename from src/org/json/JSONTokener.java rename to src/main/java/org/json/JSONTokener.java diff --git a/src/org/json/JSONWriter.java b/src/main/java/org/json/JSONWriter.java similarity index 100% rename from src/org/json/JSONWriter.java rename to src/main/java/org/json/JSONWriter.java diff --git a/src/org/json/None.java b/src/main/java/org/json/None.java similarity index 100% rename from src/org/json/None.java rename to src/main/java/org/json/None.java diff --git a/src/org/json/XML.java b/src/main/java/org/json/XML.java similarity index 100% rename from src/org/json/XML.java rename to src/main/java/org/json/XML.java diff --git a/src/org/json/XMLTokener.java b/src/main/java/org/json/XMLTokener.java similarity index 100% rename from src/org/json/XMLTokener.java rename to src/main/java/org/json/XMLTokener.java From bbdaf2b277ff1caa9967b1267a299287008e1aeb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 3 Apr 2015 02:25:52 +0530 Subject: [PATCH 020/102] Utils for Tests --- .../java/com/semantics3/api/TestUtils.java | 20 +++++++++++++++++++ src/test/resources/api.config.sample | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 src/main/java/com/semantics3/api/TestUtils.java create mode 100644 src/test/resources/api.config.sample diff --git a/src/main/java/com/semantics3/api/TestUtils.java b/src/main/java/com/semantics3/api/TestUtils.java new file mode 100644 index 0000000..a65b155 --- /dev/null +++ b/src/main/java/com/semantics3/api/TestUtils.java @@ -0,0 +1,20 @@ +package com.semantics3.api; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +/** + * Created by abishek on 03/04/15. + */ +public class TestUtils { + public static Properties getConfig(String fileName) throws IOException { + Properties property = new Properties(); + InputStream input = TestUtils.class.getClassLoader().getResourceAsStream(fileName); + if(input==null){ + System.out.println("Sorry, unable to find " + fileName); + } + property.load(input); + return property; + } +} diff --git a/src/test/resources/api.config.sample b/src/test/resources/api.config.sample new file mode 100644 index 0000000..2f16042 --- /dev/null +++ b/src/test/resources/api.config.sample @@ -0,0 +1,2 @@ +API_KEY= +API_SECRET= From 1f29937196bc22582ee3adba9a2246dfbe84d7cb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 3 Apr 2015 02:28:00 +0530 Subject: [PATCH 021/102] TestCases for Products API --- .../java/com/semantics3/api/ProductsTest.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/test/java/com/semantics3/api/ProductsTest.java diff --git a/src/test/java/com/semantics3/api/ProductsTest.java b/src/test/java/com/semantics3/api/ProductsTest.java new file mode 100644 index 0000000..327fbc1 --- /dev/null +++ b/src/test/java/com/semantics3/api/ProductsTest.java @@ -0,0 +1,73 @@ +package com.semantics3.api; + +import oauth.signpost.exception.OAuthCommunicationException; +import oauth.signpost.exception.OAuthExpectationFailedException; +import oauth.signpost.exception.OAuthMessageSignerException; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Test; + +import java.io.IOException; +import java.util.Properties; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +/** + * Created by abishek on 03/04/15. + */ +public class ProductsTest { + @Test + public void TestProductsQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products.productsField("search", "iphone"); + JSONObject results = products.getProducts(); + JSONArray resultsArray = (JSONArray) results.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } + + @Test + public void TestUPCQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products.productsField("upc", "883974958450"); + products.productsField("fields", "name", "gtins"); + JSONObject results = products.getProducts(); + JSONArray resultsArray = (JSONArray) results.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } + + @Test + public void TestURLQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products.productsField("url", "http://www.walmart.com/ip/15833173"); + JSONObject results = products.getProducts(); + JSONArray resultsArray = (JSONArray) results.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } + + @Test + public void TestPriceFilterQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products + .productsField("search", "iphone") + .productsField("price", "lt", 300); + JSONObject results = products.getProducts(); + JSONArray resultsArray = (JSONArray) results.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } + + @Test + public void TestCategoryIDQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products + .categoriesField("cat_id", 4992); + JSONObject results = products.getCategories(); + JSONArray resultsArray = (JSONArray) results.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } +} From 90ebfb6308d83bbbc717a095bc2e609902d9e78b Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 3 Apr 2015 02:29:54 +0530 Subject: [PATCH 022/102] Adding README --- README.md | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1d11522 --- /dev/null +++ b/README.md @@ -0,0 +1,154 @@ +# semantics3-java +semantics3-java is a Java client for accessing the Semantics3 Products API, which provides structured information, including pricing histories, for a large number of products. +See https://www.semantics3.com for more information. + +## Installation +* The JAVA version used for this library is JDK 7. + +* To build and install from the latest source: + +```git clone git@github.com:Semantics3/semantics3-java.git``` + +## Requirements +* [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation + +* [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation + +* JDK >= 6 + +## Getting Started + +In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at +https://www.semantics3.com/ +You can access your API access credentials from the user dashboard at https://www.semantics3.com/dashboard/applications + +### Setup Work + +Let's lay the groundwork. + +```java +import com.semantics3.api.Products; + +/* Set up a client to talk to the Semantics3 API using your Semantics3 API Credentials */ +Products products = new Products( + "SEM3xxxxxxxxxxxxxxxxxxxxxx", + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +); +``` + +### First Request aka 'Hello World': + +Let's make our first Request! We are going to run a simple search fo the word "iPhone" as follows: + +```java +/* Build the Request */ +products + .productsField( "search", "iphone" ); + +/* Make the Request */ +JSONObject results = products.getProducts(); +/* or */ +results = products.get(); + +/* View the results of the Request */ +System.out.println(results); +``` + +## Sample Requests + +The following Requests show you how to interface with some of the core functionality of the Semantics3 Products API : + +### UPC Query + +Running a UPC/EAN/GTIN request is as simple as running a search request: + + ```java +/* Build the Request */ +products + .productsField( "upc", "883974958450" ) + .productsField( "fields", "name","gtins" ); + +/* Make the Request */ +JSONObject results = products.getProducts(); +/* or */ +results = products.get(); + +/* View the results of the Request */ +System.out.println(results); +``` + +### URL Query + +Get the picture? You can run URL Requests as follows: + +```java +products + .productsField( "url", "http://www.walmart.com/ip/15833173" ); + JSONObject results = products.getProducts(); + System.out.println(results); +``` + +### Price Filter + +Filter by price using the "lt" (less than) tag: + +```java +products + .productsField( "search", "iphone" ) + .productsField( "price", "lt", 300 ); + JSONObject results = products.getProducts(); + System.out.println(results); +``` + +### Category ID Query + +To lookup details about a cat_id, run your request against the categories resource: + +```java +/* Build the query */ +products + .categoriesField( "cat_id", 4992 ); + +/* Execute the query */ + JSONObject results = products.getCategories(); + +/* View the results of the query */ + System.out.println(results); +``` + +## Contributing +Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . + +## Authors + +* Shawn Tan + +* Asmit Kumar + +## Copyright + +Copyright (c) 2015 Semantics3 Inc. + +## License + + The "MIT" License + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + From 2212bc9c8c01594e8081dbf97039ce1bcb07e1d6 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 3 Apr 2015 12:24:00 +0530 Subject: [PATCH 023/102] Adding Support for Webhooks --- pom.xml | 3 +- .../com/semantics3/api/Semantics3Request.java | 90 ++++++++++++++++++- .../semantics3/api/Semantics3RequestTest.java | 64 +++++++++++++ 3 files changed, 152 insertions(+), 5 deletions(-) create mode 100644 src/test/java/com/semantics3/api/Semantics3RequestTest.java diff --git a/pom.xml b/pom.xml index 9bb6530..06436fe 100644 --- a/pom.xml +++ b/pom.xml @@ -19,8 +19,7 @@ oauth.signpost signpost-core - 1.2 - compile + 1.2.1 commons-codec diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index 68fcc3f..6e1d268 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -10,6 +10,8 @@ import org.json.JSONTokener; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; @@ -48,7 +50,27 @@ public Semantics3Request(String apiKey, String apiSecret, String endpoint) { this.consumer = new DefaultOAuthConsumer(apiKey, apiSecret); consumer.setTokenWithSecret("", ""); } - + + public Semantics3Request(String apiKey, String apiSecret) { + if (apiKey == null) { + throw new Semantics3Exception( + "API Credentials Missing", + "You did not supply an apiKey. Please sign up at https://semantics3.com/ to obtain your api_key." + ); + } + if (apiSecret == null) { + throw new Semantics3Exception( + "API Credentials Missing", + "You did not supply an apiSecret. Please sign up at https://semantics3.com/ to obtain your api_key." + ); + } + + this.apiKey = apiKey; + this.apiSecret = apiSecret; + this.consumer = new DefaultOAuthConsumer(apiKey, apiSecret); + consumer.setTokenWithSecret("", ""); + } + protected JSONObject fetch(String endpoint, String params) throws OAuthMessageSignerException, OAuthExpectationFailedException, @@ -70,7 +92,53 @@ protected JSONObject fetch(String endpoint, String params) throws return json; } - + + protected JSONObject fetch(String endpoint, String method, HashMap params) throws + OAuthMessageSignerException, + OAuthExpectationFailedException, + OAuthCommunicationException, + IOException { + String req = new StringBuffer() + .append(API_BASE) + .append(endpoint) + .toString(); + URL url = new URL(req); + + HttpURLConnection request = (HttpURLConnection) url.openConnection(); + request.setRequestProperty("User-Agent", "Semantics3 Java Library"); + if(method == "POST") { + request.setDoInput(true); + request.setDoOutput(true); + request.setRequestMethod(method); + request.setRequestProperty("Content-Type", "application/json"); + request.setRequestProperty("Accept", "application/json"); + consumer.sign(request); + JSONObject jsonParams = new JSONObject(params); + OutputStreamWriter outputStreamWriter = new OutputStreamWriter(request.getOutputStream()); + outputStreamWriter.write(jsonParams.toString()); + outputStreamWriter.flush(); + outputStreamWriter.close(); + } + else { + request.setRequestMethod(method); + consumer.sign(request); + } + request.connect(); + try { + JSONObject json = new JSONObject(new JSONTokener(request.getInputStream())); + if (!json.has("code")){ + json.put("code", "OK"); + } + return json; + } + catch (IOException e) { + InputStream error = ((HttpURLConnection) request).getErrorStream(); + JSONObject json = new JSONObject(new JSONTokener(error)); + json.put("code", "Error"); + return json; + } + } + public Semantics3Request add(String endpoint, Object... fields) { JSONObject endpointQuery; if ((endpointQuery = query.get(endpoint)) == null) { @@ -148,7 +216,23 @@ protected void runQuery(String endpoint) throws } } - + + protected JSONObject runQuery(String endpoint, String method, HashMap params) throws + OAuthMessageSignerException, + OAuthExpectationFailedException, + OAuthCommunicationException, + IOException { + this.queryResult = fetch(endpoint, method, params); + if (!this.queryResult.getString("code").equals("OK")) { + throw new Semantics3Exception( + this.queryResult.getString("code"), + this.queryResult.getString("message") + ); + + } + return this.queryResult; + } + public JSONObject get() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { return get(this.endpoint); } diff --git a/src/test/java/com/semantics3/api/Semantics3RequestTest.java b/src/test/java/com/semantics3/api/Semantics3RequestTest.java new file mode 100644 index 0000000..6888c70 --- /dev/null +++ b/src/test/java/com/semantics3/api/Semantics3RequestTest.java @@ -0,0 +1,64 @@ +package com.semantics3.api; + +import com.semantics3.errors.Semantics3Exception; +import oauth.signpost.exception.OAuthCommunicationException; +import oauth.signpost.exception.OAuthExpectationFailedException; +import oauth.signpost.exception.OAuthMessageSignerException; +import org.hamcrest.CoreMatchers; +import org.json.JSONArray; +import org.json.JSONObject; +import org.junit.Test; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Properties; + +import static org.hamcrest.CoreMatchers.anything; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +/** + * Created by abishek on 03/04/15. + */ +public class Semantics3RequestTest { + @Test + public void testRunQueryPost() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + Properties property = TestUtils.getConfig("api.config"); + Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + HashMap params = new HashMap(); + params.put("webhook_uri", "http://148.251.44.168:5000"); + try { + JSONObject result = sem3.runQuery("webhooks", "POST", params); + assertThat(result.getString("code"), equalTo("OK")); + } catch (Semantics3Exception e) { + String message = e.getMessage(); + assertThat(message, anything("Duplicate")); + } + } + + @Test + public void testRunQueryGet() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + Properties property = TestUtils.getConfig("api.config"); + Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + HashMap params = new HashMap(); + JSONObject result = sem3.runQuery("webhooks", "GET", params); + assertThat(result.getJSONArray("data").length(), CoreMatchers.anyOf(equalTo(0), equalTo(1))); + + } + + @Test + public void testRunQueryDelete() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + Properties property = TestUtils.getConfig("api.config"); + Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + HashMap params = new HashMap(); + JSONObject result = sem3.runQuery("webhooks", "GET", params); + JSONArray data = result.getJSONArray("data"); + if (data.length() > 0) { + JSONObject webhooks = (JSONObject) data.get(0); + String webhooksId = webhooks.getString("id"); + String endpoint = "webhooks/" + webhooksId; + JSONObject response = sem3.runQuery(endpoint, "DELETE", params); + assertThat(response.getString("code"), equalTo("OK")); + } + } +} From 580ff24b4a7d97b98d737e2d7682e33ddcaf77e5 Mon Sep 17 00:00:00 2001 From: Asmit Date: Fri, 3 Apr 2015 16:08:08 +0530 Subject: [PATCH 024/102] Webhooks Documentation. --- README.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/README.md b/README.md index 1d11522..895555b 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,106 @@ products System.out.println(results); ``` +### Webhooks + +You can use webhooks to get near-real-time price updates from Semantics3. + +## Creating a webhook + +You can register a webhook with Semantics3 by sending a POST request to ```"webhooks"``` endpoint. To verify that your URL is active, a GET request will be sent to your server with a ```verification_code``` parameter. Your server should respond with ```verification_code``` in the response body to complete the verification process. + +``` + String apiKey = "SEM3xxxxxxxxxxxxxxxxxxxxxx"; + String apiSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; + String endpoint = "webhooks"; + Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + HashMap params = new HashMap(); + params.put("webhook_uri", "http://mydomain.com/webhooks-callback-url"); + JSONObject results = request.runQuery(endpoint, "POST", params); + System.out.println(results.toString(4)); +``` +To fetch existing webhooks + +``` + String endpoint = "webhooks"; + Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + HashMap params = new HashMap(); + params.put("", ""); + JSONObject results = request.runQuery(endpoint, "GET", params); + System.out.println(results.toString(4)); +``` +To remove a webhook + +``` + String webhookId = "7JcGN81u"; + String endpoint = "webhooks/" + webhookId; + Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + + HashMap params = new HashMap(); + params.put("", ""); + + JSONObject results = request.runQuery(endpoint, "DELETE", params); + System.out.println(results.toString(4)); +``` + +### Registering events + +Once you register a webhook, you can start adding events to it. Semantics3 server will send you notifications when these events occur. To register events for a specific webhook send a POST request to the ```"webhooks/{webhook_id}/events"``` endpoint + +``` + String webhookId = "7JcGN81u"; + String endpoint = "webhooks/" +webhookId+ "/events"; + + Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + + String json = "{\"type\": \"price.change\"," + + "\"product\": " + + "{\"sem3_id\": \"1QZC8wchX62eCYS2CACmka\"}," + + "\"constraints\": " + + "{ \"gte\": 10, \"lte\": 100}}"; + + HashMap params = new HashMap(); + params.put("params", "json"); + + JSONObject results = request.runQuery(endpoint, "POST", params); + System.out.println(results.toString(4)); +``` + +To fetch all registered events for a give webhook + +``` + String webhookId = "7JcGN81u"; + String endpoint = "webhooks/" +webhookId+ "/events"; + + Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + HashMap params = new HashMap(); + + params.put("", ""); + JSONObject results = request.runQuery(endpoint, "GET", params); +``` +## Webhook Notifications + +Once you have created a webhook and registered events on it, notifications will be sent to your registered webhook URI via a POST request when the corresponding events occur. Make sure that your server can accept POST requests. Here is how a sample notification object looks like + +``` +{ + "type": "price.change", + "event_id": "XyZgOZ5q", + "notification_id": "X4jsdDsW", + "changes": [{ + "site": "abc.com", + "url": "http://www.abc.com/def", + "previous_price": 45.50, + "current_price": 41.00 + }, { + "site": "walmart.com", + "url": "http://www.walmart.com/ip/20671263", + "previous_price": 34.00, + "current_price": 42.00 + }] +} + +``` ## Contributing Use GitHub's standard fork/commit/pull-request cycle. If you have any questions, email . From 72e753ac9b7e2e4db699127ab88fca2ff7dd18aa Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sat, 4 Apr 2015 20:38:01 +0530 Subject: [PATCH 025/102] Fix Webhooks Sample in Documentation. --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 895555b..d804dc0 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ You can register a webhook with Semantics3 by sending a POST request to ```"webh String apiSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; String endpoint = "webhooks"; Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); + HashMap params = new HashMap(); params.put("webhook_uri", "http://mydomain.com/webhooks-callback-url"); JSONObject results = request.runQuery(endpoint, "POST", params); System.out.println(results.toString(4)); @@ -139,8 +139,7 @@ To fetch existing webhooks ``` String endpoint = "webhooks"; Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - params.put("", ""); + HashMap params = new HashMap(); JSONObject results = request.runQuery(endpoint, "GET", params); System.out.println(results.toString(4)); ``` @@ -151,8 +150,7 @@ To remove a webhook String endpoint = "webhooks/" + webhookId; Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - params.put("", ""); + HashMap params = new HashMap(); JSONObject results = request.runQuery(endpoint, "DELETE", params); System.out.println(results.toString(4)); @@ -174,8 +172,8 @@ Once you register a webhook, you can start adding events to it. Semantics3 serve "\"constraints\": " + "{ \"gte\": 10, \"lte\": 100}}"; - HashMap params = new HashMap(); - params.put("params", "json"); + HashMap params = new HashMap(); + params.put("params", json); JSONObject results = request.runQuery(endpoint, "POST", params); System.out.println(results.toString(4)); @@ -188,9 +186,7 @@ To fetch all registered events for a give webhook String endpoint = "webhooks/" +webhookId+ "/events"; Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - - params.put("", ""); + HashMap params = new HashMap(); JSONObject results = request.runQuery(endpoint, "GET", params); ``` ## Webhook Notifications From 7809fc9a7ffa5d97888ee17d957730c3dcf09e93 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sat, 4 Apr 2015 23:00:01 +0530 Subject: [PATCH 026/102] params is expected to be a flat map. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d804dc0..78e9fb2 100644 --- a/README.md +++ b/README.md @@ -166,15 +166,15 @@ Once you register a webhook, you can start adding events to it. Semantics3 serve Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - String json = "{\"type\": \"price.change\"," + - "\"product\": " + - "{\"sem3_id\": \"1QZC8wchX62eCYS2CACmka\"}," + - "\"constraints\": " + - "{ \"gte\": 10, \"lte\": 100}}"; - HashMap params = new HashMap(); - params.put("params", json); - + HashMap product = new HashMap(); + HashMap constraints = new HashMap(); + params.put("type", "price.change"); + product.put("sem3_id", "1QZC8wchX62eCYS2CACmka"); + params.put("product", product); + constraints.put("gte", 10); + constraints.put("lte", 100); + params.put("constraints", constraints); JSONObject results = request.runQuery(endpoint, "POST", params); System.out.println(results.toString(4)); ``` From 2a6a75f31b0e529e90f1b3f483772596bfed64bf Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sun, 5 Apr 2015 22:53:33 +0530 Subject: [PATCH 027/102] Maven goal to create FAT JAR. --- pom.xml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 06436fe..a0ae64d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,11 +4,35 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - Sem3Java + com.semantics3.api Sem3Java 1.0-SNAPSHOT - Semantics3 Java Library + Semantics3 Java Library http://maven.apache.org + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + jar-with-dependencies + + + + + + assemble-all + package + + single + + + + + + junit @@ -27,6 +51,10 @@ 1.10 - + + scm:git:git://github.com/Semantics3/semantics3-java.git + scm:git:git@github.com:Semantics3/semantics3-java.git + https://github.com/Semantics3/semantics3-java + \ No newline at end of file From d574ebaa120b7397afdbfba312181de6a4c2eb0e Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sun, 5 Apr 2015 23:30:59 +0530 Subject: [PATCH 028/102] Download link for FAT JAR. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 78e9fb2..aa1a7eb 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.0/Sem3Java-1.0-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. + + ## Requirements * [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation From 6c357d5d0f458e5e5264a8ac4d414a1f8775dd2f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sun, 5 Apr 2015 23:39:55 +0530 Subject: [PATCH 029/102] Bump versiont to 1.0.2 --- README.md | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aa1a7eb..58cfd24 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.0/Sem3Java-1.0-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.0.2/Sem3Java-1.0.2-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. ## Requirements diff --git a/pom.xml b/pom.xml index a0ae64d..e471973 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.semantics3.api Sem3Java - 1.0-SNAPSHOT + 1.0.2-SNAPSHOT Semantics3 Java Library http://maven.apache.org @@ -57,4 +57,4 @@ https://github.com/Semantics3/semantics3-java - \ No newline at end of file + From 7d89e7609ee61c91b96488b6212017b02531ea41 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 7 Apr 2015 18:42:22 +0530 Subject: [PATCH 030/102] Set up Sonatype/Maven release workflow --- pom.xml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index e471973..6ad243b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,10 @@ - + 4.0.0 - com.semantics3.api + com.semantics3 Sem3Java - 1.0.2-SNAPSHOT + 1.0.4-SNAPSHOT Semantics3 Java Library http://maven.apache.org @@ -31,6 +29,14 @@ + + org.apache.maven.plugins + maven-release-plugin + 2.2.2 + + -Dgpg.passphrase=${gpg.passphrase} + + @@ -51,10 +57,53 @@ 1.10 + + + release-sign-artifacts + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.4 + + ${gpg.passphrase} + + + + sign-artifacts + verify + + sign + + + + + + + + scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - + + + sonatype-nexus-snapshots + Sonatype Nexus snapshot repository + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + Sonatype Nexus release repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + From 38319a0c8824e39e75f6eacac216de15a24cb62f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 7 Apr 2015 18:46:40 +0530 Subject: [PATCH 031/102] Bump Version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ad243b..5bc4975 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.0.4-SNAPSHOT + 1.1.1-SNAPSHOT Semantics3 Java Library http://maven.apache.org From 1b0e37dfb97194c355606e7d21f4a39a06727d44 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 7 Apr 2015 18:48:38 +0530 Subject: [PATCH 032/102] Update version to 1.1.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5bc4975..1575ff8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.1-SNAPSHOT + 1.1.2-SNAPSHOT Semantics3 Java Library http://maven.apache.org From 9cde1d566912b2d3b5af8a24782ada6db46f2033 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 7 Apr 2015 19:28:16 +0530 Subject: [PATCH 033/102] Skip tests on deploy --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 1575ff8..8c10978 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ maven-release-plugin 2.2.2 + deploy -Dmaven.test.skip=true -Dgpg.passphrase=${gpg.passphrase} From 6da8280c36e7baa7c1385bb318cdaca38106d350 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 14:41:33 +0530 Subject: [PATCH 034/102] Add nexus staging plugin --- pom.xml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8c10978..4585edc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.2-SNAPSHOT + 1.1.3-SNAPSHOT Semantics3 Java Library http://maven.apache.org @@ -38,6 +38,27 @@ -Dgpg.passphrase=${gpg.passphrase} + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6 + true + + oss.sonatype.org + https://oss.sonatype.org/ + ${project.version} + + + + deploy-to-sonatype + deploy + + deploy + release + + + + From d93f04ef046a26ac3f84d3c2b5bbdf9251ef0c8b Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 14:42:28 +0530 Subject: [PATCH 035/102] Bump version to 1.1.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4585edc..95ca833 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.3-SNAPSHOT + 1.1.4-SNAPSHOT Semantics3 Java Library http://maven.apache.org From 8ca6ce53dd0d87ec36285b5f66506a3a4062b5d6 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 15:45:54 +0530 Subject: [PATCH 036/102] Update pom.xml --- pom.xml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 95ca833..bdfeee3 100644 --- a/pom.xml +++ b/pom.xml @@ -41,23 +41,13 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6 + 1.6.3 true - oss.sonatype.org + ossrh https://oss.sonatype.org/ - ${project.version} + true - - - deploy-to-sonatype - deploy - - deploy - release - - - From 2ff24b4d8af3a3012eba1de01a9111d60fa1ff06 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 15:53:39 +0530 Subject: [PATCH 037/102] Bump Version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bdfeee3..c9ba464 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.4-SNAPSHOT + 1.1.5-SNAPSHOT Semantics3 Java Library http://maven.apache.org From b3e411ed88e4ccb3f10d9503f90c7d18c964b9cd Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 16:05:37 +0530 Subject: [PATCH 038/102] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58cfd24..64481bb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.0.2/Sem3Java-1.0.2-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.1.4/Sem3Java-1.1.4-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. ## Requirements From 19eca0a4b356191dc50afee6e3c95a50ee30453d Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 16:21:09 +0530 Subject: [PATCH 039/102] Make runQuery a public method --- src/main/java/com/semantics3/api/Semantics3Request.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index 6e1d268..e4f26eb 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -217,7 +217,7 @@ protected void runQuery(String endpoint) throws } } - protected JSONObject runQuery(String endpoint, String method, HashMap params) throws + public JSONObject runQuery(String endpoint, String method, HashMap params) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, From b321be578dfbbf71ca03c7ace66fa9b20d09410e Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 8 Apr 2015 16:23:13 +0530 Subject: [PATCH 040/102] Bump Version --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 64481bb..632733c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.1.4/Sem3Java-1.1.4-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.1.5/Sem3Java-1.1.5-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. ## Requirements diff --git a/pom.xml b/pom.xml index c9ba464..cbbfd45 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.5-SNAPSHOT + 1.1.6-SNAPSHOT Semantics3 Java Library http://maven.apache.org From 6c5b456a694a390aa6099b886c1fdb9532f5f8c9 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:17:35 +0530 Subject: [PATCH 041/102] Set releaseProfile --- pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cbbfd45..72c45b6 100644 --- a/pom.xml +++ b/pom.xml @@ -32,8 +32,11 @@ org.apache.maven.plugins maven-release-plugin - 2.2.2 + 2.5 + true + false + release deploy -Dmaven.test.skip=true -Dgpg.passphrase=${gpg.passphrase} From baad438f3afd0d91b62e6743f3e7999dce66b1d4 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:18:06 +0530 Subject: [PATCH 042/102] [maven-release-plugin] prepare release Sem3Java-1.1.6 --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 72c45b6..8821cf1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.6-SNAPSHOT + 1.1.6 Semantics3 Java Library http://maven.apache.org @@ -108,7 +108,8 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - + Sem3Java-1.1.6 + sonatype-nexus-snapshots From 3979e20f688571cd0b443400f52639820b76efaf Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:18:13 +0530 Subject: [PATCH 043/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8821cf1..bb6a5b7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.6 + 1.1.7-SNAPSHOT Semantics3 Java Library http://maven.apache.org @@ -108,7 +108,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.6 + HEAD From 998fd29ccb96a81a5764023c43ffdc550d75e566 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:27:29 +0530 Subject: [PATCH 044/102] [maven-release-plugin] prepare release Sem3Java-1.1.7 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bb6a5b7..82925ac 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.7-SNAPSHOT + 1.1.7 Semantics3 Java Library http://maven.apache.org @@ -108,7 +108,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.7 From 39f0d758e1bf8a301265375b33711d38959fe3b2 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:27:37 +0530 Subject: [PATCH 045/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 82925ac..d11a0c2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.7 + 1.1.8-SNAPSHOT Semantics3 Java Library http://maven.apache.org @@ -108,7 +108,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.7 + HEAD From 67d9c7fa4a0099deda2e253ea1ec77fd13e0040f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:46:12 +0530 Subject: [PATCH 046/102] Make pom.xml compatible for Sync --- pom.xml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d11a0c2..510fc48 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,38 @@ Sem3Java 1.1.8-SNAPSHOT Semantics3 Java Library - http://maven.apache.org + https://github.com/Semantics3/semantics3-java + Java bindings for Semantics3 API + + https://github.com/Semantics3/semantics3-java/issues + GitHub Issues + + + + MIT License + http://www.opensource.org/licenses/mit-license.php + repo + + + + + abishek@semantics3.com + Abishek Bhat + https://github.com/abishekk92 + abishekk92 + + + asmit@semantics3.com + Asmit Kumar + https://github.com/asmitkumar + asmitkumar + + + Shawn Tan + https://github.com/shawntan + shawntan + + From 24031b926872ae90082a253016e9795565a700f8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:53:09 +0530 Subject: [PATCH 047/102] [maven-release-plugin] prepare release Sem3Java-1.1.8 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 510fc48..6b97890 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.8-SNAPSHOT + 1.1.8 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -139,7 +139,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.8 From 1fe9c1b7f0429efe25ad5202f79c8b60809e779d Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 14:53:16 +0530 Subject: [PATCH 048/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6b97890..5e46ad9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.8 + 1.1.9-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -139,7 +139,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.8 + HEAD From 559b823051d409c7bd60b0d4ef5976fd2bb28ae2 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:19:44 +0530 Subject: [PATCH 049/102] Adding source plugin --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 5e46ad9..7a9a8e5 100644 --- a/pom.xml +++ b/pom.xml @@ -83,6 +83,18 @@ true + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + From c2025641609ca78b59fc710b1fb3257eca5b19ef Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:20:09 +0530 Subject: [PATCH 050/102] [maven-release-plugin] prepare release Sem3Java-1.1.9 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7a9a8e5..337c120 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.9-SNAPSHOT + 1.1.9 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -151,7 +151,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.9 From fd11fd0d59e2f4b72359c0afa95ae3e0bcbb8581 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:20:17 +0530 Subject: [PATCH 051/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 337c120..2da3021 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.9 + 1.1.10-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -151,7 +151,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.9 + HEAD From 2c2a7236078b8a96853ced44c3be239f849020fd Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:23:55 +0530 Subject: [PATCH 052/102] Add JavaDoc Plugin --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 2da3021..ed538ba 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,18 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + From f4781834ca4c75cee965ffb4412b7f994ae28f9b Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:24:38 +0530 Subject: [PATCH 053/102] [maven-release-plugin] prepare release Sem3Java-1.1.10 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ed538ba..763dbb1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.10-SNAPSHOT + 1.1.10 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -163,7 +163,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.10 From ce4cdc5350dd9b37f7e883aca7c91aa55e39cb40 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:24:47 +0530 Subject: [PATCH 054/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 763dbb1..3875078 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.10 + 1.1.11-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -163,7 +163,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.10 + HEAD From c948ca428b2c68e3f5443a572c6e8d94a49629aa Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:36:22 +0530 Subject: [PATCH 055/102] Remove packaging plugin --- pom.xml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pom.xml b/pom.xml index 3875078..139643b 100644 --- a/pom.xml +++ b/pom.xml @@ -40,26 +40,6 @@ - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - jar-with-dependencies - - - - - - assemble-all - package - - single - - - - org.apache.maven.plugins maven-release-plugin From 5b8659dd1e721e925e0f2df2463e63d1dcd8a500 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:37:01 +0530 Subject: [PATCH 056/102] [maven-release-plugin] prepare release Sem3Java-1.1.11 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 139643b..d0156a7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.11-SNAPSHOT + 1.1.11 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.11 From dc6d4786c5d7d4b5e36210352a584cfa291688ca Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 15:37:09 +0530 Subject: [PATCH 057/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d0156a7..0382a43 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.11 + 1.1.12-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.11 + HEAD From 19c14d8f654a63990b95a87216ce8423919b1195 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 16:55:31 +0530 Subject: [PATCH 058/102] [maven-release-plugin] prepare release Sem3Java-1.1.12 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0382a43..5bc24d0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.12-SNAPSHOT + 1.1.12 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.12 From b4f36adbbe1480adb335c64feae3a7873ebce717 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 16:55:39 +0530 Subject: [PATCH 059/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5bc24d0..e7f2800 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.12 + 1.1.13-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.12 + HEAD From 26852f6fa421f7b9f13b943362394e2633bd0965 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:00:20 +0530 Subject: [PATCH 060/102] Set autoRelaseAfterClose to false --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7f2800..5424712 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ ossrh https://oss.sonatype.org/ - true + false From 7e2e93d7adc94149a06a8238f2a7484b5a14bc43 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:01:40 +0530 Subject: [PATCH 061/102] [maven-release-plugin] prepare release Sem3Java-1.1.13 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5424712..d4d1b42 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.13-SNAPSHOT + 1.1.13 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.13 From 37fb4e1edd712ae2872dc63a58e7381ea30a3ea0 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:01:47 +0530 Subject: [PATCH 062/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d4d1b42..612da95 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.13 + 1.1.14-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.13 + HEAD From fbc42525eb2548616293019076d0918c58fc837f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:18:53 +0530 Subject: [PATCH 063/102] [maven-release-plugin] prepare release Sem3Java-1.1.14 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 612da95..b3578ac 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.14-SNAPSHOT + 1.1.14 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.14 From 4f6c9aca281b5bc6eec3f09582480057a8990edb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:19:01 +0530 Subject: [PATCH 064/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b3578ac..73dd784 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.14 + 1.1.15-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.14 + HEAD From b7d77e6c0c388f2ca086e8fc1183bca82fa909c9 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:23:25 +0530 Subject: [PATCH 065/102] Remove gpg argument --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 73dd784..31abad9 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ false release deploy -Dmaven.test.skip=true - -Dgpg.passphrase=${gpg.passphrase} + From c3e5c372a0b3b3bc908e717442b25be18d1ae65a Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:26:38 +0530 Subject: [PATCH 066/102] [maven-release-plugin] prepare release Sem3Java-1.1.15 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 31abad9..abf0b51 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.15-SNAPSHOT + 1.1.15 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.15 From 2460f6acd24f2b0635ddaceef7961b2b5c145b4f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Thu, 9 Apr 2015 17:26:45 +0530 Subject: [PATCH 067/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index abf0b51..135c6fc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.15 + 1.1.16-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -143,7 +143,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.15 + HEAD From 432abf86c9a16c089691d176ec435c907ca65930 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:39:06 +0530 Subject: [PATCH 068/102] Remove Profiles and move gpg sign into plugins section. --- pom.xml | 56 +++++++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index 135c6fc..e664545 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.semantics3 @@ -87,6 +88,23 @@ + + org.apache.maven.plugins + maven-gpg-plugin + 1.4 + + ${gpg.passphrase} + + + + sign-artifacts + verify + + sign + + + + @@ -107,44 +125,12 @@ 1.10 - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.4 - - ${gpg.passphrase} - - - - sign-artifacts - verify - - sign - - - - - - - - scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD - + HEAD + sonatype-nexus-snapshots From 5aff85dcbb1757136320d18e8a40e08af77f4ff5 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:39:37 +0530 Subject: [PATCH 069/102] [maven-release-plugin] prepare release Sem3Java-1.1.16 --- pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e664545..e093694 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 com.semantics3 Sem3Java - 1.1.16-SNAPSHOT + 1.1.16 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -129,7 +128,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.16 From ae6a9652d227ba1ebe610ab692ebd801278872ce Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:39:46 +0530 Subject: [PATCH 070/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e093694..fe0d6a7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.16 + 1.1.17-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -128,7 +128,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.16 + HEAD From 1dfa92c6230f24e490b24b4b4ca73b18be37000c Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:46:14 +0530 Subject: [PATCH 071/102] Set autoReleaseClose to true --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fe0d6a7..7236801 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,6 @@ false release deploy -Dmaven.test.skip=true - @@ -60,7 +59,7 @@ ossrh https://oss.sonatype.org/ - false + true From 19c2a55cdf48f444a8e49b527022eae4eb5a32e3 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:46:49 +0530 Subject: [PATCH 072/102] [maven-release-plugin] prepare release Sem3Java-1.1.17 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7236801..3e9e8af 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.17-SNAPSHOT + 1.1.17 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -127,7 +127,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.1.17 From 9ef2c3046025038d18e8967f9bf477738c5cd9b7 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 14:46:56 +0530 Subject: [PATCH 073/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3e9e8af..2a8efbb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.1.17 + 1.1.18-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -127,7 +127,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.1.17 + HEAD From 045614c9e53652e7fea9b1be7afc7b0ff47d2da1 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:02:36 +0530 Subject: [PATCH 074/102] Add packaging --- README.md | 2 +- pom.xml | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 632733c..be47c9d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.1.5/Sem3Java-1.1.5-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.2.0/Sem3Java-1.2.0-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. ## Requirements diff --git a/pom.xml b/pom.xml index 2a8efbb..7fa5810 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.semantics3 @@ -103,6 +104,26 @@ + + org.apache.maven.plugins + maven-assembly-plugin + 2.2.1 + + + jar-with-dependencies + + + + + + assemble-all + package + + single + + + + From d03caaed2dfaded12ab158553b09d505983163f8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:03:34 +0530 Subject: [PATCH 075/102] [maven-release-plugin] prepare release Sem3Java-1.2.0 --- pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7fa5810..089cfb5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,10 @@ - + 4.0.0 com.semantics3 Sem3Java - 1.1.18-SNAPSHOT + 1.2.0 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -148,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.0 From 4ef887c512524e4ea45b26360339eaab2624ff34 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:03:42 +0530 Subject: [PATCH 076/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 089cfb5..ddb000a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.0 + 1.2.1-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.0 + HEAD From 31b851ddc41299610b0ca3de758736361366575f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:05:59 +0530 Subject: [PATCH 077/102] [maven-release-plugin] prepare release Sem3Java-1.2.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ddb000a..64460ba 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.1-SNAPSHOT + 1.2.1 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.1 From 02d8c5ca119d5ab0afc10108eebf9426151b74f8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:06:07 +0530 Subject: [PATCH 078/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 64460ba..a25cfdb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.1 + 1.2.2-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.1 + HEAD From 66af8b4a73f4ef460d9ba440d2f2138011fb48a4 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:11:36 +0530 Subject: [PATCH 079/102] Update SNAPSHOT link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be47c9d..fd1f1f4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.2.0/Sem3Java-1.2.0-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.2.1/Sem3Java-1.2.1-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. ## Requirements From cb51b1a89f3920308008df3ddf178ca5f07ceda9 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Fri, 10 Apr 2015 15:19:37 +0530 Subject: [PATCH 080/102] Update download link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd1f1f4..2a66442 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/v1.2.1/Sem3Java-1.2.1-SNAPSHOT-jar-with-dependencies.jar) is available as fat jar. +* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is available as fat jar. ## Requirements From 296ddd2bb688369d11236bb88329a27b62afbbd6 Mon Sep 17 00:00:00 2001 From: Asmit Date: Sat, 11 Apr 2015 00:56:57 +0530 Subject: [PATCH 081/102] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a66442..3f4fcf8 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,18 @@ See https://www.semantics3.com for more information. ```git clone git@github.com:Semantics3/semantics3-java.git``` -* Otherwise, each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is available as fat jar. +* Each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is also available as fat jar. +* The Dependencies can also be installed using ```maven``` by putting this in the ```pom.xml``` file. + +``` + + com.semantics3 + Sem3Java + 1.2.1 + + +``` ## Requirements * [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation From d1df15e1872700da298dfc72bddc6d4e59d9c74d Mon Sep 17 00:00:00 2001 From: Asmit Date: Sat, 11 Apr 2015 00:57:46 +0530 Subject: [PATCH 082/102] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f4fcf8..2ee2d32 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,14 @@ See https://www.semantics3.com for more information. * Each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is also available as fat jar. -* The Dependencies can also be installed using ```maven``` by putting this in the ```pom.xml``` file. +* The Dependencies can also be installed using ```maven``` by adding this in the ```pom.xml``` file. ``` - + com.semantics3 Sem3Java 1.2.1 - ``` ## Requirements From fcd8d757fa750413f156825b3d8c009bb7ef4995 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Sun, 12 Apr 2015 21:16:12 +0530 Subject: [PATCH 083/102] Advertise maven as the go way to use the library. --- README.md | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 2ee2d32..2672af3 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,15 @@ See https://www.semantics3.com for more information. ## Installation * The JAVA version used for this library is JDK 7. -* To build and install from the latest source: - -```git clone git@github.com:Semantics3/semantics3-java.git``` - -* Each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is also available as fat jar. - -* The Dependencies can also be installed using ```maven``` by adding this in the ```pom.xml``` file. +* Add the following to your pom.xml +```xml + + com.semantics3 + Sem3Java + 1.2.1 + ``` - - com.semantics3 - Sem3Java - 1.2.1 - -``` - -## Requirements -* [signpost-core-1.2.1.2.jar](https://oauth-signpost.googlecode.com/files/signpost-core-1.2.1.2.jar) - OAuth2 implementation - -* [commons-codec-1.7.jar](http://repo1.maven.org/maven2/commons-codec/commons-codec/1.7/commons-codec-1.7.jar) - Apache Commons Codec library for Base64 implementation - -* JDK >= 6 ## Getting Started @@ -50,7 +37,7 @@ Products products = new Products( ### First Request aka 'Hello World': -Let's make our first Request! We are going to run a simple search fo the word "iPhone" as follows: +Let's make our first Request! We are going to run a simple search for the word "iPhone" as follows: ```java /* Build the Request */ @@ -229,10 +216,10 @@ Use GitHub's standard fork/commit/pull-request cycle. If you have any questions ## Authors -* Shawn Tan - * Asmit Kumar +* Shawn Tan + ## Copyright Copyright (c) 2015 Semantics3 Inc. From fced7a9ce38c4d3cf630e237f21853461d948430 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 13 Apr 2015 00:22:38 +0530 Subject: [PATCH 084/102] Add download link for Fat Jar. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2672af3..7ed9606 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ See https://www.semantics3.com for more information. ``` +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is also available as a fat jar. + ## Getting Started In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at From 1e876e541148c0cccd10167df28caf6667ab2f4e Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 13 Apr 2015 00:26:06 +0530 Subject: [PATCH 085/102] Fix formatting --- README.md | 96 +++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 7ed9606..12bf2fb 100644 --- a/README.md +++ b/README.md @@ -125,76 +125,76 @@ You can use webhooks to get near-real-time price updates from Semantics3. You can register a webhook with Semantics3 by sending a POST request to ```"webhooks"``` endpoint. To verify that your URL is active, a GET request will be sent to your server with a ```verification_code``` parameter. Your server should respond with ```verification_code``` in the response body to complete the verification process. -``` - String apiKey = "SEM3xxxxxxxxxxxxxxxxxxxxxx"; - String apiSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; - String endpoint = "webhooks"; - Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - params.put("webhook_uri", "http://mydomain.com/webhooks-callback-url"); - JSONObject results = request.runQuery(endpoint, "POST", params); - System.out.println(results.toString(4)); +```java +String apiKey = "SEM3xxxxxxxxxxxxxxxxxxxxxx"; +String apiSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +String endpoint = "webhooks"; +Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); +HashMap params = new HashMap(); +params.put("webhook_uri", "http://mydomain.com/webhooks-callback-url"); +JSONObject results = request.runQuery(endpoint, "POST", params); +System.out.println(results.toString(4)); ``` To fetch existing webhooks -``` - String endpoint = "webhooks"; - Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - JSONObject results = request.runQuery(endpoint, "GET", params); - System.out.println(results.toString(4)); +```java +String endpoint = "webhooks"; +Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); +HashMap params = new HashMap(); +JSONObject results = request.runQuery(endpoint, "GET", params); +System.out.println(results.toString(4)); ``` To remove a webhook -``` - String webhookId = "7JcGN81u"; - String endpoint = "webhooks/" + webhookId; - Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - - HashMap params = new HashMap(); +```java +String webhookId = "7JcGN81u"; +String endpoint = "webhooks/" + webhookId; +Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - JSONObject results = request.runQuery(endpoint, "DELETE", params); - System.out.println(results.toString(4)); +HashMap params = new HashMap(); + +JSONObject results = request.runQuery(endpoint, "DELETE", params); +System.out.println(results.toString(4)); ``` ### Registering events Once you register a webhook, you can start adding events to it. Semantics3 server will send you notifications when these events occur. To register events for a specific webhook send a POST request to the ```"webhooks/{webhook_id}/events"``` endpoint -``` - String webhookId = "7JcGN81u"; - String endpoint = "webhooks/" +webhookId+ "/events"; - - Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - - HashMap params = new HashMap(); - HashMap product = new HashMap(); - HashMap constraints = new HashMap(); - params.put("type", "price.change"); - product.put("sem3_id", "1QZC8wchX62eCYS2CACmka"); - params.put("product", product); - constraints.put("gte", 10); - constraints.put("lte", 100); - params.put("constraints", constraints); - JSONObject results = request.runQuery(endpoint, "POST", params); - System.out.println(results.toString(4)); +```java +String webhookId = "7JcGN81u"; +String endpoint = "webhooks/" +webhookId+ "/events"; + +Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); + +HashMap params = new HashMap(); +HashMap product = new HashMap(); +HashMap constraints = new HashMap(); +params.put("type", "price.change"); +product.put("sem3_id", "1QZC8wchX62eCYS2CACmka"); +params.put("product", product); +constraints.put("gte", 10); +constraints.put("lte", 100); +params.put("constraints", constraints); +JSONObject results = request.runQuery(endpoint, "POST", params); +System.out.println(results.toString(4)); ``` To fetch all registered events for a give webhook -``` - String webhookId = "7JcGN81u"; - String endpoint = "webhooks/" +webhookId+ "/events"; - - Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); - HashMap params = new HashMap(); - JSONObject results = request.runQuery(endpoint, "GET", params); +```java +String webhookId = "7JcGN81u"; +String endpoint = "webhooks/" +webhookId+ "/events"; + +Semantics3Request request = new Semantics3Request(apiKey, apiSecret, endpoint); +HashMap params = new HashMap(); +JSONObject results = request.runQuery(endpoint, "GET", params); ``` ## Webhook Notifications Once you have created a webhook and registered events on it, notifications will be sent to your registered webhook URI via a POST request when the corresponding events occur. Make sure that your server can accept POST requests. Here is how a sample notification object looks like -``` +```json { "type": "price.change", "event_id": "XyZgOZ5q", From e43073db941f6d24f14b3792d143663e832e5afb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 16 Jun 2015 12:35:29 +0530 Subject: [PATCH 086/102] Fix for SKUS API. --- README.md | 2 +- .../com/semantics3/api/Semantics3Request.java | 24 ++++++++++++++++--- .../java/com/semantics3/api/ProductsTest.java | 12 ++++++++++ .../semantics3/api/Semantics3RequestTest.java | 6 ++--- src/test/resources/api.config.sample | 2 ++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 12bf2fb..9cef60f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ See https://www.semantics3.com for more information. com.semantics3 Sem3Java - 1.2.1 + 1.2.2 ``` diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index e4f26eb..afe0031 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -88,9 +88,19 @@ protected JSONObject fetch(String endpoint, String params) throws request.setRequestProperty("User-Agent", "Semantics3 Java Library"); consumer.sign(request); request.connect(); - JSONObject json = new JSONObject(new JSONTokener(request.getInputStream())); - - return json; + try { + JSONObject json = new JSONObject(new JSONTokener(request.getInputStream())); + if (!json.has("code")){ + json.put("code", "OK"); + } + return json; + } + catch (IOException e) { + InputStream error = ((HttpURLConnection) request).getErrorStream(); + JSONObject json = new JSONObject(new JSONTokener(error)); + json.put("code", "Error"); + return json; + } } protected JSONObject fetch(String endpoint, String method, HashMap params) throws @@ -222,7 +232,15 @@ public JSONObject runQuery(String endpoint, String method, HashMap 0, is(true)); } + + @Test + public void TestSKUQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { + Properties property = TestUtils.getConfig("api.config"); + Semantics3Request semantics3Request = new Semantics3Request(property.get("SKU_API_KEY").toString(), property.get("SKU_API_SECRET").toString()); + HashMap params = new HashMap(); + params.put("site", "abercrombie.com"); + JSONObject jsonObject = semantics3Request.runQuery("skus", "GET", params); + JSONArray resultsArray = (JSONArray) jsonObject.get("results"); + assertThat(resultsArray.length() > 0, is(true)); + } } diff --git a/src/test/java/com/semantics3/api/Semantics3RequestTest.java b/src/test/java/com/semantics3/api/Semantics3RequestTest.java index 6888c70..a08cdeb 100644 --- a/src/test/java/com/semantics3/api/Semantics3RequestTest.java +++ b/src/test/java/com/semantics3/api/Semantics3RequestTest.java @@ -4,7 +4,6 @@ import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; -import org.hamcrest.CoreMatchers; import org.json.JSONArray; import org.json.JSONObject; import org.junit.Test; @@ -13,6 +12,7 @@ import java.util.HashMap; import java.util.Properties; +import static junit.framework.Assert.assertTrue; import static org.hamcrest.CoreMatchers.anything; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @@ -26,7 +26,7 @@ public void testRunQueryPost() throws IOException, OAuthCommunicationException, Properties property = TestUtils.getConfig("api.config"); Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); - params.put("webhook_uri", "http://148.251.44.168:5000"); + params.put("webhook_uri", " http://sem3-webhooks-verification.ngrok.com"); try { JSONObject result = sem3.runQuery("webhooks", "POST", params); assertThat(result.getString("code"), equalTo("OK")); @@ -42,7 +42,7 @@ public void testRunQueryGet() throws IOException, OAuthCommunicationException, O Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); JSONObject result = sem3.runQuery("webhooks", "GET", params); - assertThat(result.getJSONArray("data").length(), CoreMatchers.anyOf(equalTo(0), equalTo(1))); + assertTrue(result.getJSONArray("data").length() > 0); } diff --git a/src/test/resources/api.config.sample b/src/test/resources/api.config.sample index 2f16042..a0a986b 100644 --- a/src/test/resources/api.config.sample +++ b/src/test/resources/api.config.sample @@ -1,2 +1,4 @@ API_KEY= API_SECRET= +SKU_API_KEY= +SKU_API_SECRET= From 2ead0790b68eafeba95e25b48748a31ad3f192cb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 16 Jun 2015 12:38:28 +0530 Subject: [PATCH 087/102] [maven-release-plugin] prepare release Sem3Java-1.2.2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a25cfdb..3b98c0c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.2-SNAPSHOT + 1.2.2 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.2 From a399a9d73d0d54d309879b650f7d0114c024f3a8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 16 Jun 2015 12:38:37 +0530 Subject: [PATCH 088/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3b98c0c..e25a173 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.2 + 1.2.3-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.2 + HEAD From 7f6233b4663c96a19836ca389ace6c39234f52ad Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Tue, 16 Jun 2015 12:50:19 +0530 Subject: [PATCH 089/102] Update FAT Jar Link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cef60f..0807ba2 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ See https://www.semantics3.com for more information. ``` -* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.1/Sem3Java-1.2.1-jar-with-dependencies.jar) is also available as a fat jar. +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.2/Sem3Java-1.2.2-jar-with-dependencies.jar) is also available as a fat jar. ## Getting Started From 0f89dfddf5973c0799362f223207dc8039fe68fd Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 15:59:29 +0530 Subject: [PATCH 090/102] Fix failing tests cases. --- src/test/java/com/semantics3/api/Semantics3RequestTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/semantics3/api/Semantics3RequestTest.java b/src/test/java/com/semantics3/api/Semantics3RequestTest.java index a08cdeb..4c66bdc 100644 --- a/src/test/java/com/semantics3/api/Semantics3RequestTest.java +++ b/src/test/java/com/semantics3/api/Semantics3RequestTest.java @@ -12,7 +12,6 @@ import java.util.HashMap; import java.util.Properties; -import static junit.framework.Assert.assertTrue; import static org.hamcrest.CoreMatchers.anything; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @@ -42,7 +41,7 @@ public void testRunQueryGet() throws IOException, OAuthCommunicationException, O Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); JSONObject result = sem3.runQuery("webhooks", "GET", params); - assertTrue(result.getJSONArray("data").length() > 0); + assertThat(result.getString("code"), equalTo("OK")); } @@ -61,4 +60,5 @@ public void testRunQueryDelete() throws IOException, OAuthCommunicationException assertThat(response.getString("code"), equalTo("OK")); } } + } From ae9d69bb158ad88bb3a2ae79d86d574a01161c4f Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 15:59:49 +0530 Subject: [PATCH 091/102] Ignore pagination tests. --- .../java/com/semantics3/api/ProductsTest.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/semantics3/api/ProductsTest.java b/src/test/java/com/semantics3/api/ProductsTest.java index 8de0f4f..4b700ec 100644 --- a/src/test/java/com/semantics3/api/ProductsTest.java +++ b/src/test/java/com/semantics3/api/ProductsTest.java @@ -5,6 +5,7 @@ import oauth.signpost.exception.OAuthMessageSignerException; import org.json.JSONArray; import org.json.JSONObject; +import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -75,11 +76,29 @@ public void TestCategoryIDQuery() throws OAuthExpectationFailedException, OAuthC @Test public void TestSKUQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException { Properties property = TestUtils.getConfig("api.config"); - Semantics3Request semantics3Request = new Semantics3Request(property.get("SKU_API_KEY").toString(), property.get("SKU_API_SECRET").toString()); + Semantics3Request semantics3Request = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); params.put("site", "abercrombie.com"); JSONObject jsonObject = semantics3Request.runQuery("skus", "GET", params); JSONArray resultsArray = (JSONArray) jsonObject.get("results"); assertThat(resultsArray.length() > 0, is(true)); } + + @Ignore + public void TestPagination() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + Properties property = TestUtils.getConfig("api.config"); + Semantics3Request semantics3Request = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + HashMap params = new HashMap(); + params.put("site", "macys.com"); + JSONObject jsonObject = semantics3Request.runQuery("skus", "GET", params); + while(jsonObject.has("next")){ + JSONObject next = (JSONObject)jsonObject.get("next"); + String page = next.getString("page"); + System.out.println(page); + params.remove("site"); + params.put("page", page); + jsonObject = semantics3Request.runQuery("skus", "GET", params); + System.out.println(jsonObject.toString()); + } + } } From 222f210729f73f32d941605ad25c28540165902c Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:19:51 +0530 Subject: [PATCH 092/102] Normalize URL. --- .../java/com/semantics3/api/Categories.java | 8 ++-- src/main/java/com/semantics3/api/Offers.java | 8 ++-- .../java/com/semantics3/api/Products.java | 13 +++--- .../com/semantics3/api/Semantics3Request.java | 45 ++++++++++--------- .../java/com/semantics3/api/ProductsTest.java | 15 ++++--- .../semantics3/api/Semantics3RequestTest.java | 8 ++-- 6 files changed, 50 insertions(+), 47 deletions(-) diff --git a/src/main/java/com/semantics3/api/Categories.java b/src/main/java/com/semantics3/api/Categories.java index 22ad6aa..3c35149 100644 --- a/src/main/java/com/semantics3/api/Categories.java +++ b/src/main/java/com/semantics3/api/Categories.java @@ -1,13 +1,13 @@ package com.semantics3.api; -import java.io.IOException; - import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; - import org.json.JSONObject; +import java.io.IOException; +import java.net.URISyntaxException; + public class Categories extends Semantics3Request { public Categories(String apiKey, String apiSecret) { @@ -19,7 +19,7 @@ public Categories field(Object... fields) { return this; } - public JSONObject getCategories() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { + public JSONObject getCategories() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException, URISyntaxException { return this.get(); } diff --git a/src/main/java/com/semantics3/api/Offers.java b/src/main/java/com/semantics3/api/Offers.java index f592351..ba22a5d 100644 --- a/src/main/java/com/semantics3/api/Offers.java +++ b/src/main/java/com/semantics3/api/Offers.java @@ -1,13 +1,13 @@ package com.semantics3.api; -import java.io.IOException; - import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; - import org.json.JSONObject; +import java.io.IOException; +import java.net.URISyntaxException; + public class Offers extends Semantics3Request { public Offers(String apiKey, String apiSecret) { @@ -19,7 +19,7 @@ public Offers field(Object... fields) { return this; } - public JSONObject getOffers() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { + public JSONObject getOffers() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException, URISyntaxException { return this.get(); } diff --git a/src/main/java/com/semantics3/api/Products.java b/src/main/java/com/semantics3/api/Products.java index a52199e..711c834 100644 --- a/src/main/java/com/semantics3/api/Products.java +++ b/src/main/java/com/semantics3/api/Products.java @@ -1,14 +1,13 @@ package com.semantics3.api; -import java.io.IOException; - +import com.semantics3.Util; import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; - import org.json.JSONObject; -import com.semantics3.Util; +import java.io.IOException; +import java.net.URISyntaxException; public class Products extends Semantics3Request { @@ -17,13 +16,13 @@ public Products(String apiKey, String apiSecret) { // TODO Auto-generated constructor stub } - public JSONObject getProducts() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { + public JSONObject getProducts() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException, URISyntaxException { return this.get(); } - public JSONObject getOffers() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { + public JSONObject getOffers() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException, URISyntaxException { return this.get("offers"); } - public JSONObject getCategories() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException { + public JSONObject getCategories() throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException, IOException, URISyntaxException { return this.get("categories"); } diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index afe0031..c5cce25 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -13,6 +13,7 @@ import java.io.InputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLEncoder; import java.util.HashMap; @@ -72,10 +73,10 @@ public Semantics3Request(String apiKey, String apiSecret) { } protected JSONObject fetch(String endpoint, String params) throws - OAuthMessageSignerException, - OAuthExpectationFailedException, - OAuthCommunicationException, - IOException { + OAuthMessageSignerException, + OAuthExpectationFailedException, + OAuthCommunicationException, + IOException, URISyntaxException { String req = new StringBuffer() .append(API_BASE) .append(endpoint) @@ -83,7 +84,7 @@ protected JSONObject fetch(String endpoint, String params) throws .append(URLEncoder.encode(params, "UTF-8")) .toString(); URL url = new URL(req); - + url = url.toURI().normalize().toURL(); HttpURLConnection request = (HttpURLConnection) url.openConnection(); request.setRequestProperty("User-Agent", "Semantics3 Java Library"); consumer.sign(request); @@ -107,13 +108,13 @@ protected JSONObject fetch(String endpoint, String method, HashMap params = new HashMap(); @@ -85,7 +86,7 @@ public void TestSKUQuery() throws OAuthExpectationFailedException, OAuthCommunic } @Ignore - public void TestPagination() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + public void TestPagination() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request semantics3Request = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); diff --git a/src/test/java/com/semantics3/api/Semantics3RequestTest.java b/src/test/java/com/semantics3/api/Semantics3RequestTest.java index 4c66bdc..135dc1f 100644 --- a/src/test/java/com/semantics3/api/Semantics3RequestTest.java +++ b/src/test/java/com/semantics3/api/Semantics3RequestTest.java @@ -9,6 +9,7 @@ import org.junit.Test; import java.io.IOException; +import java.net.URISyntaxException; import java.util.HashMap; import java.util.Properties; @@ -21,7 +22,7 @@ */ public class Semantics3RequestTest { @Test - public void testRunQueryPost() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + public void testRunQueryPost() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); @@ -36,7 +37,7 @@ public void testRunQueryPost() throws IOException, OAuthCommunicationException, } @Test - public void testRunQueryGet() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + public void testRunQueryGet() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); @@ -46,7 +47,7 @@ public void testRunQueryGet() throws IOException, OAuthCommunicationException, O } @Test - public void testRunQueryDelete() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException { + public void testRunQueryDelete() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request sem3 = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); HashMap params = new HashMap(); @@ -61,4 +62,5 @@ public void testRunQueryDelete() throws IOException, OAuthCommunicationException } } + } From 42f1cee51ba1e495de9ea5384f00f993fcd20b67 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:21:45 +0530 Subject: [PATCH 093/102] [maven-release-plugin] prepare release Sem3Java-1.2.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e25a173..a300dd7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.3-SNAPSHOT + 1.2.3 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.3 From 2180bc73114572b1de22ee8d361db9cfa4466bcb Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:21:53 +0530 Subject: [PATCH 094/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a300dd7..0542cc3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.3 + 1.2.4-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.3 + HEAD From ffd6c00d7cd9a9509696f63c6d4615d3a8d2a615 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:27:23 +0530 Subject: [PATCH 095/102] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0807ba2..272e441 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ See https://www.semantics3.com for more information. ``` -* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.2/Sem3Java-1.2.2-jar-with-dependencies.jar) is also available as a fat jar. +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.3/Sem3Java-1.2.3-jar-with-dependencies.jar) is also available as a fat jar. ## Getting Started From 30efd6c141897a873f9550a5065480180639ce7a Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Wed, 9 Sep 2015 16:28:40 +0530 Subject: [PATCH 096/102] Update version number in mvn install. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 272e441..69e5764 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ See https://www.semantics3.com for more information. com.semantics3 Sem3Java - 1.2.2 + 1.2.3 ``` From dfdf78a86f75f1c61f92ec28b2a602eb9efc87e8 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:08:24 +0530 Subject: [PATCH 097/102] Fix failing test case. --- src/test/java/com/semantics3/api/ProductsTest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/test/java/com/semantics3/api/ProductsTest.java b/src/test/java/com/semantics3/api/ProductsTest.java index c14de75..c195143 100644 --- a/src/test/java/com/semantics3/api/ProductsTest.java +++ b/src/test/java/com/semantics3/api/ProductsTest.java @@ -68,13 +68,7 @@ public void TestCategoryIDQuery() throws OAuthExpectationFailedException, OAuthC Properties property = TestUtils.getConfig("api.config"); Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); products - .categoriesField("cat_id", 4992); - JSONObject results = products.getCategories(); - JSONArray resultsArray = (JSONArray) results.get("results"); - assertThat(resultsArray.length() > 0, is(true)); - } - - @Test + .categoriesField("cat_id", 4992); JSONObject results = products.getCategories(); JSONArray resultsArray = (JSONArray) results.get("results"); assertThat(resultsArray.length() > 0, is(true)); } @Test public void TestSKUQuery() throws OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, IOException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); Semantics3Request semantics3Request = new Semantics3Request(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); From aeaa551a8cc18e55ded3af56c20ab63ad465a964 Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:08:54 +0530 Subject: [PATCH 098/102] Add error code to exception. --- .../com/semantics3/api/Semantics3Request.java | 22 ++++++++++++++----- .../java/com/semantics3/api/ProductsTest.java | 9 ++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/semantics3/api/Semantics3Request.java b/src/main/java/com/semantics3/api/Semantics3Request.java index c5cce25..f3c3b87 100644 --- a/src/main/java/com/semantics3/api/Semantics3Request.java +++ b/src/main/java/com/semantics3/api/Semantics3Request.java @@ -99,7 +99,13 @@ protected JSONObject fetch(String endpoint, String params) throws catch (IOException e) { InputStream error = ((HttpURLConnection) request).getErrorStream(); JSONObject json = new JSONObject(new JSONTokener(error)); - json.put("code", "Error"); + if (!json.has("code")) { + json.put("code", "Error"); + } + else { + Object value = json.get("code"); + json.put("code", value.toString()); + } return json; } } @@ -145,7 +151,13 @@ protected JSONObject fetch(String endpoint, String method, HashMap 0, is(true)); } + @Test(expected = Semantics3Exception.class) + public void TestSiteQuery() throws IOException, OAuthExpectationFailedException, OAuthCommunicationException, OAuthMessageSignerException, URISyntaxException { + Properties property = TestUtils.getConfig("api.config"); + Products products = new Products(property.get("API_KEY").toString(), property.get("API_SECRET").toString()); + products .productsField("url", "zsdfseobn.com/sdgeafg"); + JSONObject results = products.getProducts(); + } + @Ignore public void TestPagination() throws IOException, OAuthCommunicationException, OAuthExpectationFailedException, OAuthMessageSignerException, URISyntaxException { Properties property = TestUtils.getConfig("api.config"); From 8b1e4f3b130f71622eae41aac8b2458f18e46fdc Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:10:58 +0530 Subject: [PATCH 099/102] [maven-release-plugin] prepare release Sem3Java-1.2.4 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0542cc3..34faf84 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.4-SNAPSHOT + 1.2.4 Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - HEAD + Sem3Java-1.2.4 From 26f267c547dfb650e554bfc0f505981f90825aab Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:11:08 +0530 Subject: [PATCH 100/102] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 34faf84..cea89bf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.semantics3 Sem3Java - 1.2.4 + 1.2.5-SNAPSHOT Semantics3 Java Library https://github.com/Semantics3/semantics3-java Java bindings for Semantics3 API @@ -147,7 +147,7 @@ scm:git:git://github.com/Semantics3/semantics3-java.git scm:git:git@github.com:Semantics3/semantics3-java.git https://github.com/Semantics3/semantics3-java - Sem3Java-1.2.4 + HEAD From 4b3eda08a51b076b05260245d1ebd6c70d037c6c Mon Sep 17 00:00:00 2001 From: abishekk92 Date: Mon, 16 Nov 2015 19:21:04 +0530 Subject: [PATCH 101/102] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 69e5764..fef66c4 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ See https://www.semantics3.com for more information. com.semantics3 Sem3Java - 1.2.3 + 1.2.4 ``` -* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.3/Sem3Java-1.2.3-jar-with-dependencies.jar) is also available as a fat jar. +* For projects which don't use Maven each stable [release](https://github.com/Semantics3/semantics3-java/releases/download/Sem3Java-1.2.4/Sem3Java-1.2.4-jar-with-dependencies.jar) is also available as a fat jar. ## Getting Started From 5ccbab5721b0b2d049a98f9f88bba78b8754741a Mon Sep 17 00:00:00 2001 From: Amarnath Ravikumar Date: Fri, 14 Apr 2017 17:48:46 +0530 Subject: [PATCH 102/102] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fef66c4..79cbf36 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://www.semantics3.com for more information. In order to use the client, you must have both an API key and an API secret. To obtain your key and secret, you need to first create an account at https://www.semantics3.com/ -You can access your API access credentials from the user dashboard at https://www.semantics3.com/dashboard/applications +You can access your API access credentials from the user dashboard at https://dashboard.semantics3.com. ### Setup Work