GitXplorerGitXplorer
i

Clj-GoogleApiJava

public
6 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
984fe3ce84e37885fcd235b4b775a677b8a2e7d7

Actually search for the query

iianbarber committed 12 years ago
Unverified
3a14a6437937631445f059c4effd886dd5156d09

Initial checkin

committed 12 years ago

README

The README file for this repository.

clj-easygoog

Very quick example on calling Google APIs using the Java client libraries from Clojure. Queries the Google+ Public Data API using Simple Authentication. Requires a file in this directory called 'config.clj' containing an API key:

(def GOOGLE_API_KEY "KEY_GOES_HERE") 

The key can be generated from https://developers.google.com/console ("api clients") - this is also where the Google+ service can be enabled ("services").

It should be relatively easy to call any other Google API service using similar constructs.

Historical Note: In older versions of the Java Google Client Libraries, the API key was stored in an anonymous subclass of the JsonHttpRequestInitializer. If for some reason you require an older version, you can use the (proxy) method to support that:

(def json-init (proxy [JsonHttpRequestInitializer] []
   (initialize [httpreq]
    (.setKey httpreq GOOGLE_API_KEY))))

Usage

;; Perform a search for activities (posts) on Google+ containing the word "clojure" (pprint (search "clojure"))

License

Copyright (C) 2012 Google

Distributed under the Apache 2.0 license.