ColdFusion , Twitter , CFTwitterLib

ColdFusion Twitter Lib updated

February 17, 2010

In this version were added following the methods groups:

  • List Methods
  • List Members Methods
  • List Subscribers Methods
  • Spam Reporting Methods
  • Saved Searches Methods

ColdFusion Twitter Lib

More

Twitter , CFTwitterLib

CFTwitterLib - TweetDiff - example application in ColdFusion for Twitter

3 Comments 8/30/09

One more use example of the library ColdFusion for access to Twitter, this application will not be continued, it is a mere example. It got so good that I solved increase layout.

More

Twitter

Twitter announces project

August 13, 2009

Twitter makes announcement on the project retweet, which is still on paper.

More

ColdFusion , Twitter , CFTwitterLib

CFTwitterLib in ColdFusion Open-Source List

April 24, 2009

The Project ColdFusion Twitter Lib - cftwitterlib, it is available also in the Projects great list Open Source kept by Brian Rinaldi.

Thanks, Brain, by the mention.

More

ColdFusion , Twitter , CFTwitterLib

ColdFusion Twitter Lib - getUserTimeline

April 22, 2009

With this method you can retrieve messages from a Twitter user.

<!--- Twitter user used by the system --->
<cfparam name="userTwitter" default="">
<!--- password from Twitter user used by the system --->
<cfparam name="passTwitter" default="">
<!--- login to Twitter friend we want to recover the messages --->
<cfparam name="friendTwitter" default="">
<cfif Len(Trim(friendTwitter))>
    <!--- Object used in this page --->
    <cfset twitter = CreateObject('component','org.cftwitterlib.Twitter').init(userTwitter,passTwitter)>
    <!--- start the variable to be passed as parameter --->
    <cfset options = StructNew() >
    <!--- login to Twitter friend --->
    <cfset options['screen_name'] = friendTwitter >
    <!--- number of messages per page --->
    <cfset options['count'] = 10 >
    <!--- number of page --->
    <cfset options['page'] = 1 >
    <!--- recover the messages --->
    <cfset timeline = deserializeJSON(twitter.getUserTimeline(options).toString()) >
    <!--- messages exists --->
    <cfif IsArray(timeline)>
        <cfoutput>
            <!--- displays each message's friend --->
            <cfloop from="1" to="#ArrayLen(timeline)#" index="i">
        <div style="border:1px solid ##000; padding:5px; width:350px;">
            <dl style="margin:0">
                <dt style="margin:0">
                    <!--- if the friend sent the message in response, retrieves and displays the original message --->
                    <cfif timeline[i].in_reply_to_status_id neq "null">
                        <cfset currentMsg = deserializeJSON(twitter.getStatus(timeline[i].in_reply_to_status_id).toString())>
                        <div>
                            <img src="#currentMsg.user.profile_image_url#" height="20" />
                            <a name="message_#currentMsg.id#"></a>
                            <cfif currentMsg.favorited> <img src="images/cool.gif" /></cfif>
                            #DateFormat(currentMsg.created_at,'dd-mm-yyyy')# #timeFormat(currentMsg.created_at,'hh:mm:ss')#
                            -
                            #currentMsg.text#                    
                        </div>
                    </cfif></dt>
                <dd style="margin:0; <cfif Len(Trim(timeline[i].in_reply_to_status_id))>margin-left:10px</cfif>"><img src="#timeline[i].user.profile_image_url#" height="20" />
                            <a name="message_#timeline[i].id#"></a>
                            <cfif timeline[i].favorited> <img src="images/cool.gif" /></cfif>
                            #DateFormat(timeline[i].created_at,'dd-mm-yyyy')# #timeFormat(timeline[i].created_at,'hh:mm:ss')#
                            -
                            #timeline[i].text#</dd>
                    </dl>
                </div>        
            </cfloop>
        </cfoutput>
    <cfelse>
        <!--- the limit of request on account is 100 --->
        Rate limit exceeded.
    </cfif>
</cfif>

public string getUserTimeline(struct options, [string format])

options = Data structure containing the options you want, at least the id or screen_name or user_id should be passed.

options.id = identifier of the user in Twitter (different from login)

options.user_id = identifier of the user in Twitter (different from login)

options.screen_name = name (login) of user in Twitter

options.since_id = identifier of the user in Twitter (different from login)

options.page = number of current page

options.count = number of messages per page

format (opcional, json is default) = xml, json, rss, atom

More

ColdFusion , Twitter , CFTwitterLib

ColdFusion Twitter Lib - follow

April 22, 2009

With this method you can add friends of Twitter for one account Twitter.

<!--- friend to be added --->
<cfparam name="friend" default="" />
<cfif Len(Trim(friend))>
    <!--- objects that will work on this pages --->
<cfset twitter = createObject('component','org.cftwitterlib.Twitter').init(application.usertwitter,application.passtwitter) />

<!--- it recovers one account twitter --->
<cfset friendAccount = deserializeJSON(twitter.showUser(friend)) />

    <!--- it exhibits friend's information who is going to be added --->
<h1><cfoutput><img src="#friendAccount.profile_image_url#" /> #friendAccount.name# - #friend# (#friendAccount.followers_count#)</cfoutput> </h1>

<!--- it verifies tells her of the friend future is blocked --->
<cfif NOT friendAccount.protected>

    <!--- it verifies we are already friends --->
<cfif NOT deserializeJSON(twitter.friendshipExists(application.usertwitter,friend)) >

    <!--- it adds friend --->
<cfset     follow = deserializeJSON(twitter.follow(friendAccount.id)) />
<b style="color:#090">it was added</b>

<cfelse>
<b style="color:#09F">it is already your friend</b>
</cfif>
<cfelse>
<b style="color:#F00">It is protected, for this reason it was not added</b>
</cfif>

</cfif>

public string follow(string id, [string format])

id = identifier of the user in Twitter (different from login)

format (optional, json is default) = xml, json

More

ColdFusion , Twitter , CFTwitterLib

ColdFusion Twitter Lib with BlogCFC

2 Comments 4/20/09

Very well, BlogCFC integrated with Twitter.

Now the posts of BlogCFC send messages through Twitter, this is done on the page that adds entries in BlogCFC.

With CFTwitterLib the BlogCFC can interact more with Twitter, but, I just leave it (sending post to Twitter).

Is used to share with you how I did it.

Before starting you should decide how you will inform your credential on your blog.ini.cfm, I chose to generate the credential separately with toBase64, catching the result and putting in the ini file, as follows:

More

ColdFusion , Twitter , CFTwitterLib

ColdFusion Twitter Lib V3.0 in RiaForge

1 Comments 4/20/09

The library to ColdFusion access the Twitter,cftwitterlib, is now in version 3, with all bugs fixed (I hope so).

The project was added to RiaForge http://cftwitterlib.riaforge.org/.

<cfset twitter = createObject('component','Twitter').init('username','password') />

<cfset xmlString = twitter.updateStatus('Message for your friend','FriendID','xml') />

<cfset xmlString = twitter.updateStatus('Message','','xml') />
<cfdump var="#variables#">

More

Subscribe

Enter your email address to subscribe to this blog.

Digitrum Servers Powered by Blogcfc 5.9.2.002