In future versions of the Android framework will be possible to integrate Twitter with our XOne application.
The method to use is defining a collection that uses the <connection> node that points toward Twitter, and this one will show the tweets wall we want to.
The simplified connection string is this one:
<connection name="ConnectionToTwitter" connstring="Provider=Xone Remote Provider;ProgID=com.xone.db.twitter.TwitterConnection;Tweets Limit=50" />
If we want to associate a Twitter account to our application and do not require any user extra interaction, we must go to the account settings and get there the 4 necessary tokens, which are the Consumer Key, the Consumer Key Secret, the Access Token and the Access Token Secret.
The consumer key can be understood as the ID of the application that Twitter uses, and the secret of the consumer key as its password.
In turn, the access token identifies the user who will use Twitter in that application, and its secret as its password for this application.
All this is necessary for the applications that use Twitter do not save the user and password of the Twitter users.
The connection string will have this format:
<connection name="ConnectionToTwitter" connstring="Provider=Xone Remote Provider;ProgID=com.xone.db.twitter.TwitterConnection;Twitter Consumer Key=CLAVECONSUMIDORAQUÍ;Twitter Consumer Secret=SECRETOCONSUMIDORAQUÍ;Twitter Access Token=TOKENACCESOAQUÍ;Twitter Access Token Secret=SECRETOTOKENUSUARIOAQUÍ;Tweets Limit=50" />
Not having defined tokens, when this collection needs to make an startbrowse, being through script, through content or through list mode, first of all, the Twitter user name will be requested, then it will launch the browser in order the user authorizes to use its account.
Once authorized, the user must copy the access PIN that will be shown at the browser window and come back to the XOne application, which will ask it to enter.
These data will not be asked again, if the user is not changed.
<coll name="Twitter" title="Twitter" connection="ConnectionToTwitter" check-owner="false" dependent="false" fontsize="8" sql="SELECT * FROM ##PREF##Twitter t1" objname="Twitter" updateobj="Twitter" notab="true" filter="" sort="" progid="ASData.CASBasicDataObj"> <connection name="ConnectionToTwitter" connstring="Provider=Xone Remote Provider;ProgID=com.xone.db.twitter.TwitterConnection;Tweets Limit=50" /> <group name="General" id="1" /> <prop name="ID" visible="0" group="1" type="N" fieldsize="30" labelwidth="8" size="255" title="ID" /> <prop name="DISPLAYNAME" visible="6" group="1" title="Usuario" type="T" fieldsize="30" fixed-text="true" size="255" labelwidth="5" /> <prop name="TWEETDESTINATION" visible="1" group="1" title="Destino" type="T" fieldsize="30" fixed-text="true" size="255" labelwidth="5" /> <prop name="TWEETTEXT" visible="15" group="1" title="Texto" type="T" fieldsize="30" fixed-text="true" size="255" labelwidth="5" /> </coll>
Following, we define a content. As can be seen, at the filter is defined the wall of tweets to use. If we do not want to use a hashtag and showing the wall of an specific user instead, the filter will be something like filter=“USERORHASHTAG='xonetest'”
<coll name="TestTwitter" title="Menú principal" special="true" notab="true" fontsize="8" sql="" objname="" updateobj="" filter="" sort="" progid="ASData.CASBasicDataObj" autorefresh="true"> <group name="Grupo01" id="1" /> <prop name="@ContentTwitter" group="1" type="Z" title=" " width="100%" height="85%" contents="ContentTwitter" lines="6" onchange="refresh255" editmodal="true" forceonchange="true" mask="31" /> <contents name="ContentTwitter" src="Twitter" filter="USERORHASHTAG='#gatos'" /> </coll>
If no filter is specified, it will be displayed the user´s wall of the access token.
It exists a VBScript object associated tothe Twitter connection.
This method logs out and forgets the access tokens of an user specified by parameter.
Because of the Twitter TOS, it is mandatory to implement this button.
Set obj01 = CreateObject("Twitter") obj01.Logout "nombreusuario" Set obj01 = nothing
Same than the previous method, but this one forgets all the associated users.
Set obj01 = CreateObject("Twitter") obj01.RevokeAllTokens Set obj01 = nothing