winterstein / jtwitter Goto Github PK
View Code? Open in Web Editor NEWJava library for using Twitter (+ Identica & Wordpress). Open source under LGPL
Home Page: http://www.winterwell.com/software/jtwitter.php
Java library for using Twitter (+ Identica & Wordpress). Open source under LGPL
Home Page: http://www.winterwell.com/software/jtwitter.php
onPageStarted is called twice. I haven't identified why - It could be an Android OS/device specific for the handling of the WebView.
The first received url is correct, the second is logged as someurl.com/mf.php - therefore verifier == null and onFail is subsequently called
Suggest adding to line 92:
if ( ! url.contains(callbackUrl)) return;
to become:
if ( ! url.contains(callbackUrl) && ! url.endsWith("mf.php")) return;
Or if this is too specific, prevent onFail being called if onSuccess has already been called:
if ( ! url.contains(callbackUrl) && ! success) return;
Where:
boolean success = false;
Is placed inside run() and set to true prior to line 106:
dialog.dismiss();
onSuccess(jtwitter, tokens);
Email me if you need any more info.
Cheers
Ben
I wanted to compile your library from source to use with a Java 7 project but I had trouble finding the winterwell.utils code that JTwitter depends on. From previous change log entries (3.1.0: - Cleaned out some winterwell.utils references which had sneaked into /src.
) it seems like this was an oversight. I managed to find a version of the winterwell.utils library in the Eclipse Markdown Editor Plugin repo but it's not clear if this is 100% compatible. Could you remove the dependencies on this library or provide an up-to-date version of the library that can be used when compiling from source? Thanks.
Implementation for deleting a direct message is different from the twitter api. Twitter rest api expects direct message id as post parameter not in the url itself. Every time I'm getting this error message --code 34: Sorry, that page does not exist https://api.twitter.com/1.1/direct_messages/destroy/176917417644138497.json
I'm trying to use JTwitter in an Android app, but it doesn't work because OAuthScribeClient
uses DefaultOAuthProvider
, not CommonsHttpOAuthProvider
I tried forking the repo and changing this myself, but there are some dependencies I'm missing.
Following the example on the website everything works until I get to getOAuthAccessToken
:
java.lang.NullPointerException
at twitter4j.HttpParameter.containsJson(HttpParameter.java:171)
at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:129)
at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
at twitter4j.HttpClientBase.post(HttpClientBase.java:86)
at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:125)
at twitter4j.TwitterBaseImpl.getOAuthAccessToken(TwitterBaseImpl.java:340)
Any feedback on how to resolve this issue?
Command Line: java -jar jtwitter.jar {username} {password} tweet
Console Display:
Exception in thread "main" winterwell.jtwitter.TwitterException$IO: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at winterwell.jtwitter.URLConnectionHttpClient.getPage2_ex(URLConnectionHttpClient.java:317)
at winterwell.jtwitter.URLConnectionHttpClient.post(URLConnectionHttpClient.java:392)
at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:2910)
at winterwell.jtwitter.Twitter.updateStatus(Twitter.java:2845)
at winterwell.jtwitter.Twitter.setStatus(Twitter.java:2633)
at winterwell.jtwitter.Twitter.main(Twitter.java:719)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:961)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at winterwell.jtwitter.URLConnectionHttpClient.post2_connect(URLConnectionHttpClient.java:432)
at winterwell.jtwitter.URLConnectionHttpClient.post2(URLConnectionHttpClient.java:402)
at winterwell.jtwitter.URLConnectionHttpClient.post(URLConnectionHttpClient.java:370)
... 4 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
... 19 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
... 25 more
Calling run() on the AndroidTwitterLogin class results in an java.lang.NoSuchMethodError Exception.
AndroidTwitterLogin login =
new AndroidTwitterLogin(this, CONSUMER_KEY, CONSUMER_SECRET, null) {
@Override
protected void onSuccess(Twitter arg0, String[] arg1) {
Toast.makeText(SearchResultsActivity.this, "Login successful", Toast.LENGTH_LONG).show();
}
};
login.run();
results in
java.lang.NoSuchMethodError: android.util.Log.i
at winterwell.jtwitter.android.AndroidTwitterLogin.run(AndroidTwitterLogin.java:78)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.