How do I import Twitter's new JSON feed into AEM? | Community
Skip to main content
October 16, 2015
Solved

How do I import Twitter's new JSON feed into AEM?

  • October 16, 2015
  • 7 replies
  • 2676 views

Hi there,

With Twitter's updated API and change to only support JSON feeds, instead of RSS, the existing AEM 5.6.1 Feed Importer doesn't work for their feeds.  Is there another way to accomplish this i.e. import a JSON feed?

Thanks,

RKB.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Yogesh_Upadhyay

Scott is right. You have to use Oauth to get authenticated with twitter API to get JSON feed. We ended up using https://code.google.com/p/oauth-signpost/ to establish that connection. Hope it will help.

Yogesh

7 replies

smacdonald2008
Level 10
October 16, 2015

This community article was updated to use the new Twitter feed:

[img]Widget2.png[/img]

See: http://scottsdigitalcommunity.blogspot.ca/2013/02/creating-aem-feed-components-that.html

October 16, 2015

Hi Scott,

I looked at your article, however, our requirement is to import the clients tweets, continuously, and store them in the JCR.  Basically, the exact functionality of the Feed Importer, just with a Feed Type = JSON.  Will Adobe be adding such a Feed Type?  If not, could I add it to my AEM instance?  If not, how would I develop a custom JSON importer, that stores the imported data into the JCR?

Thanks.

 
smacdonald2008
Level 10
October 16, 2015

Twitter updated the API last Spring -  around April 2013 or so.

We used to be able to hook into the feed - but the API change that Twitter made (I think for security and to block unauthenticated access) prevented that.

See:

https://dev.twitter.com/discussions/18496

smacdonald2008
Level 10
October 16, 2015

You can use JSON with Twitter:

https://dev.twitter.com/docs/api/1.1/overview

But now -- you need to authenticate using OAuth:

Authentication required on all endpoints

In version 1.1, we're requiring applications to authenticate all of their requests with OAuth 1.0a or Application-only authentication. Not only will this visibility allow us to prevent abusive behavior, but it will also help us to further understand how categories of applications are using the API. We'll apply that understanding to better meet the needs of developers as we continue to evolve the platform. At this time, all authentication requires user context, but in the coming weeks we'll be pushing out support for a form of authentication not requiring a user context.

So you can use the widget code without using OAuth or use OAuth to get JSON feeds.

October 16, 2015

Yeah, I'm aware of their new requirements since the API update this past Spring.

Thanks for the info.  I'll have to figure something out.

Yogesh_Upadhyay
Yogesh_UpadhyayAccepted solution
Level 6
October 16, 2015

Scott is right. You have to use Oauth to get authenticated with twitter API to get JSON feed. We ended up using https://code.google.com/p/oauth-signpost/ to establish that connection. Hope it will help.

Yogesh

Adobe Employee
October 16, 2015

FYI - the next version of ACS AEM Commons will have a easy way to instantiate a Twitter API client (using the Twitter4J library) from a Twitter Connect cloud service configuration or a page on a site which is configured with a Twitter Connect configuration.

The work-in-progress documentation can be seen at https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/gh-pages/_drafts/2013-10-10-twitter.md