BusinessObjects Board

twitter feed

Does anybody know how I can capture a live twitter feed now it’s all changed on twitter? I tried following Ryan Goodman’s excellent blog, but apparently twitter no longer directly supports an RSS feed and when I tried to set up an XML map it asks me for a twitter account and password, which I don’t have.

I’m sure it used to be easy…

Debbie


Debbie :uk: (BOB member since 2005-03-01)

Hi Debbie

Yes it can be done but you have to use a third party now as twitter has changed its settings. http://tweet-2-rss.appspot.com/

try this, it worked for me :slight_smile:

Thanks
Richard


richiecaws :uk: (BOB member since 2011-03-03)

Thanks, Richard. Unfortunately our firewall won’t let me access that url. Been doing a lot more googling and I can’t see any other way other than 3rd party apps which will take me months to get approved in this place.

Sigh…

Debbie


Debbie :uk: (BOB member since 2005-03-01)

That’s a very interesting concept. I hadn’t considered using twitter as a feed on a dashboard.

I’ve used XML maps on weather feeds to pull through daily forecasts, tidal predicitions and storm force warnings but I hadn’t considered twitter as a source.

Thanks folks, that’s given me something to consider.


Ozzy_BOBJ :australia: (BOB member since 2013-03-20)

It used to be really simple… I set one up a couple of years back as a test because it looked really cool! 8)

But now I actually want to use it, it’s far more complicated, of course. Doesn’t help that our firewall randomly pings stuff that’s connected with social networking! Had to tell my boss I might be logging on to my personal twitter account, so I could have play with something I have the password for, rather than our public twitter stream.

Debbie


Debbie :uk: (BOB member since 2005-03-01)

So I’ve just found that on our main external website at http://www.cheshire.police.uk/ we are capturing twitter somehow.

I’m not a web person, but if I view the source code for the page, there’s a line of code that starts:

<a class="twitter-timeline" href="url....

plus data widget ids and a . Way over my head!

How do I re-use this existing feed in xcelsius? I have no idea what to do with it - what component to use or how to configure it.

Ta

debbie


Debbie :uk: (BOB member since 2005-03-01)

@debbie - Your problems are always the most challenging problems.

Anyway, I was messing around with some possibilities. I think the RSS way of doing things was harder than the current way. The current way is using the Twitter API functions.

Here is an article about an XML document, using the new Twitter API functions, which should return bits of a Twitter account
.

Here is the twitter API home page that has a list of functions and authentication instructions.

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

My point is that I think you can use the information in the first link to create an XML map. Embed that into the SWF. The XML looks simple enough!

I have some time today…Im actually going to try it out. If I am successful, Ill update.


Cairmor :us: (BOB member since 2008-06-05)

ok That took about 15 minutes !

I was able to get this to work in Dashboards 4 sp3 and Xcelsius 2008 sp5. I do not have other versions to test. I did prove that what you want to do is possible, with very little coding experience.

I returned a UserName, and the Date the Twitter account was created. This live Twitter information was displayed in a SpreadSheet component, embedded inside the SWF itself. You will have alot of work to do to get exactly the types of tweet information you want, but I think the documention exists for you to figure it out.

My Basic Steps:

  1. Make a new XLF
  2. Go to the IBM tutorial. There is a bit of XML code on the middle of that page (my first link above)
  3. Copy into Notepad. Save as XML.
  4. Setup XML Map inside XLF (see notes below)
  5. Create Data Connector to XML Map
  6. Drop Spreadsheet component on XML Map Range
  7. Preview.

At this point you should see a Date, and the title of “Twitter Updates from Joel Comm”…depending on what elements you brought over on the XML Map.

I used: ns1:link, type, rel, href, and ns1: updated

To get at the raw Twitter post content you will probably have to carefully read the IBM article to learn how to modify the base XML document, then use the API reference (the 2nd link) for the function names to pull whatever you are after (e.g. last 10 tweets from someone)

POST EDIT:

I was able to get all the xml attributes on the SWF, including capturing a tweet, by mapping the entire Attribute called onto the Excel worksheet area.

e.g.

<entry>
      <title>joelcomm: thinking...</title>
      <content type="html">joelcomm: thinking...</content>
      <id>tag:twitter.com,2007:http://twitter.com/joelcomm/statuses/1369295498</id>
      <published>2009-03-22T05:15:01+00:00</published>
      <updated>2009-03-22T05:15:01+00:00</updated>
      <link type="text/html" rel="alternate" 
	 href="http://twitter.com/joelcomm/statuses/1369295498"/>
      <link type="image/jpeg" rel="image" 
		href="http://s3.amazonaws.com/joel1_normal.jpg"/>
      <author>
        <name>Joel Comm</name>
        <uri>http://www.JoelComm.com</uri>
      </author>
    </entry>

[i]Note: You cannot update or edit an Excel Map AFTER creating the XML Map connector. It will corrupt the XML Map Connector, and the XML Map connector will no longer work or refresh.

If you edit or update the Excel Map, Delete the XML Map Connector and create it again.[/i]


Cairmor :us: (BOB member since 2008-06-05)

I wouldn’t want you to get bored! 8)

Thanks so much for this. Will have a play when I get a minute. Tied up right now looking at a whole list of R3 reports for migration into BI4, but twitter is far more fun…

Debbie


Debbie :uk: (BOB member since 2005-03-01)

Started playing with this, but not getting very far.

Looking at the IBM tutorial, I couldn’t get the Listing 1 to even work in a browser. It said I could just paste the url in but all I got was a 404 error. I even tried capturing my own personal twitter account (I’m @debjbennett, so I put in debjbennett)

So when I tried to set up an XML map inside xcelsius it just gave me a parse error and failed. :frowning:

I’m using 2008 SP5, btw.

debbie

ETA: Oh wait a minuite. I think I’m being incredibly thick here. I might just be getting somewhere now I’ve put the right bit of code into an XML file… :crazy_face:


Debbie :uk: (BOB member since 2005-03-01)

Nope, I’m still not getting this. I copy/pasted the text at Listing 3 into notepad and saved as XML. Created an XML map in xcelsius and pulled it in and put a spreadsheet component over it… I have two rows of data.

Created an XML map connector, and when I hit preview I see more or less the same two rows. It doesn’t show me anything meaningful…

Debbie


Debbie :uk: (BOB member since 2005-03-01)

ok, Ill get back to you soon with more steps. Probably something simple in the steps that I forgot to mention!


Cairmor :us: (BOB member since 2008-06-05)

ok I was looking at the steps again. After re-reading your posts…Im assuming you are returning some data, and the connector is at least working ?

I re-created this file from scratch and was able to get it working again.
I did notice that despite me not making any changes to the XML map, I had to do two things.

  1. Test the XML connection inside Excel (by clicking the refresh button inside Excel) to make sure it does pull data from twitter.
  2. After I created the XML Map connector inside Xcelsius, it still wouldnt run automatically. After I created the connector, I deleted it, and re-created it again…it always works on the 2nd attempt.

But to address your comment about not getting anything meaningful. That XML example only returns one single Twitter post.

And that post says only

“Thinking…” You will find this profound phrase in the XML column (in your map) NS1: Content.

This example is not terribly exciting.

Can you confirm if you are pulling that tweet or not ? Or if the query is even running ?


Cairmor :us: (BOB member since 2008-06-05)

last update: Twitter API v 1.1 now requires Authentication, so that we cannot download twitter feeds anon.

Im not sure what this means for SWF’s yet. The complexity of the integration has greatly increased, however. I dont have any good answers to beat the authentication bit yet, but now Im working on it for my own amusement.


Cairmor :us: (BOB member since 2008-06-05)

Does that mean it’s not worth my time playing with this right now? Got some universe design stuff I have to finish this week, so not got chance to look at it right now - but I really do appreciate your help & advice… :yesnod:

Debbie


Debbie :uk: (BOB member since 2005-03-01)

ya…give it a break. Their is a new rule : Twitter doesnt want anyone reading Tweets without first authenticating either your own twitter account or your applications account.

During my experiments earlier in this thread, I was being cookied and authenticated…which was working…based on my own twitter login.

In short, yes we can get tweets inside a SWF. But now you have to register your application (which is just getting a name/pw) and collect a key (unique id) for your app. All this auth information goes into the XML page. I already have the XML bit down tha tinvolves pulling tweets into the SWF (using methods described earlier in the thread). I am currently struggling with getting the authentication part to work.

Eventually, Ill have an XML document ready that does all this. As stated earlier, this information would be very valuable for the Xcelsius community.

PS. I read some tweets about Cheshire while I was testing code. It sounds like a great town if you like drinking, drinking and driving, partying, the occasional street brawl, general burglary, and other mischeivious activity.

My kind of place :wink:


Cairmor :us: (BOB member since 2008-06-05)