Twitter-search

From GreenVulcano Wiki
Jump to: navigation, search

Description

GreenVulcano® ESB allows, using the Twitter operations, to invoke the API exposed by the social platform to search tweets.

Return the found tweets as XML document.

VulCon / GV Console Configuration

Following a description of twitter-search element.

The following table shows the element's attributes:

Attribute Type Description
type fixed This attribute must assume the value call.
class fixed This attribute must assume the value it.greenvulcano.gvesb.virtual.social.twitter.TwitterSearchCallOperation.
name required Operation name. Used in the 'Flow' section to associate workflow nodes to VCL operations.
dynamic optional Specify if the account attribute can contain placeholders to be resolved at runtime.
account required Twitter account name.
query required Twitter query, the syntax can be found here. Can contains placeholders to be resolved at runtime.
userId optional Id or name of the user from wich read the timeline. If not defined, is assumed the @account user.

Can contains placeholders to be resolved at runtime.

sinceId optional Minimun status Id of the user's timeline to read from. Can contains placeholders to be resolved at runtime.
maxId optional Maximum status Id of the user's timeline to read from. Can contains placeholders to be resolved at runtime.
since optional Minimun status generation date to read from. Can contains placeholders to be resolved at runtime.

Must be in the format YYYY-MM-DD.

until optional Maximum status generation date to read from. Can contains placeholders to be resolved at runtime.

Must be in the format YYYY-MM-DD.

count optional Number of status to read. Can contains placeholders to be resolved at runtime.

Default to 20.

With a sample query="from:ACME_Auto_Insurance", the result XML is formatted as follow:

<?xml version="1.0" encoding="UTF-8"?>
<TwitterQuery createdAt="2014-04-10T16:23:22+0200" user="ACME_Auto_Insurance" userId="0000000000">
    <Tweet createdAt="2014-03-24T18:51:25+0100"
           fromUser="ACME - Auto Insurance"
           fromUserId="0000000000">A user had an Average driving week with 80% driving score. User program score is now 90%!</Tweet>
    <Tweet createdAt="2014-03-24T18:51:10+0100"
           fromUser="ACME - Auto Insurance"
           fromUserId="0000000000">A user did a fair hard braking on 12/10/2013 at 7:54 a.m. . From 34 Mph to 20 Mph in 0.6 seconds!</Tweet>
    <Tweet createdAt="2014-03-24T18:50:11+0100"
           fromUser="ACME - Auto Insurance"
           fromUserId="0000000000">A user did a trip on 12/10/2013 at 7:34 a.m. driving 200 miles in 1.30 hours.</Tweet>
</TwitterQuery>