drone29a / clojure-twitter

Clojure client for Twitter API
BSD 2-Clause "Simplified" License
120 stars 33 forks source link

problem on GAE #4

Closed denlab closed 13 years ago

denlab commented 13 years ago

Hi,

Great lib, works fine locally. But when deployed on GAE, https doesn't works (javax.net.ssl.HttpsURLConnection is a restricted class). So I swiched to regular http:

(twitter/with-oauth

instead of :

(twitter/with-https (twitter/with-oauth

In fact even if I only :require the twitter lib without using it, it breaks.

Here's the stacktrace: https://gist.github.com/973086

A solution could be to use HttpConnection instead of HttpsConnection, the former is on the GAE whitelist.

Any hints ?

thx

Denis

denlab commented 13 years ago

I forgot: even with regular http it still breaks, as if httpsconnection was loaded anyway

drone29a commented 13 years ago

This I'm going to fix by changing how the lib works. The lib should allow you to inject your own base fetch function. Are you able to hack up a workaround in the meantime?

denlab commented 13 years ago

Well the workaround was to fall back to using a java lib (shame on me! :) It's twitter4j, it is GAE-proof, and I needed 2 lines to call it:

(:import (twitter4j TwitterFactory Query)))

;; raw results from twitter (def raw-results (.search (.getInstance (TwitterFactory.)) (Query. "#sfeir")))

see: https://github.com/denlab/twitalyse/blob/master/src/twitalyse/twitter.clj

Denis

drone29a commented 13 years ago

Heh, glad you got something working. Until I get to the refactor I mentioned above, twitter4j is a good alternative.