Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Since writing my original article on integrating with twitter using the twitter4j library, twitter has updated their api and the twitter4j library was subsequently updated accordingly. Here is the new code for using twitter4j version 3.0.x.

<cfset cb = createObject("Java", "twitter4j.conf.ConfigurationBuilder") />

<cfset cb.setDebugEnabled(true)>
<cfset cb.setOAuthConsumerKey("yourconsumerkey")>
<cfset cb.setOAuthConsumerSecret("yourconsumersecret")>
<cfset cb.setOAuthAccessToken("youraccesstoken")>
<cfset cb.setOAuthAccessTokenSecret("youraccesstoken secret")>

<cfset twitterFactory = createObject("Java", "twitter4j.TwitterFactory").Init(cb.build()) />
<cfset twitter = twitterFactory.getInstance()>

<cfset status = twitter.updateStatus("test")>

Related Blog Postings

What Do You Think?

Reader Comments

Gilles Tanguay's Gravatar
Gilles Tanguay
Wednesday, October 7, 2015 at 3:29:55 PM EDT

Hi,

When I try a test post, I get this error:

Error Occurred While Processing Request
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

You can see it here:
http://www.emploifeep.com/tweet/

Any hints??

Thanks

Gilles

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.

*
*



Archives Blog Listing

Tag Listing

Learn CF In A Week

Treehouse

 
Fork me on GitHub