| Property | ||
|---|---|---|
| application_source type: string | ||
| currentStatus type: string | ||
| hourly_limit type: numeric | ||
| http_status type: numeric | ||
| last_api_call type: string | ||
| My type: struct | ||
| nextResetHits type: date | ||
| password type: string | ||
| remaining_hits type: numeric | ||
| reset_time type: date | ||
| screenname type: string | ||
| userid type: string | ||
| version type: string | ||
| Constructors | |||
|---|---|---|---|
public Twitter |
|
||
| Methods | |||
|---|---|---|---|
private string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
endSession([string format])
|
||
private string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public numeric |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
getPublicTimeline([string format])
|
||
public numeric |
|
||
public string |
|
||
public date |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
getTrendsCurrent([boolean exclude])
|
||
public string |
getTrendsDaily(Struct options)
|
||
public string |
getTrendsWeekly(Struct options)
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
private boolean |
|
||
public boolean |
|
||
public string |
|
||
public numeric |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
searchesSaved([string format])
|
||
public string |
|
||
public string |
|
||
private void |
|
||
private void |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
|
||
public string |
verifyCredentials([string format])
|
||
| application_source |
Type
|
|||||||
| currentStatus |
Type
|
|||||||
| hourly_limit |
Type
|
|||||||
| http_status |
Type
|
|||||||
| last_api_call |
Type
|
|||||||
| My |
Type
|
|||||||
| nextResetHits |
Type
|
|||||||
| password |
Type
|
|||||||
| remaining_hits |
Type
|
|||||||
| reset_time |
Type
|
|||||||
| screenname |
Type
|
|||||||
| userid |
Type
|
|||||||
| version |
Type
|
|||||||
| buildURL |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="buildURL" access="private" output="false" returntype="string">
<cfargument name="method" type="String" required="true" >
<cfargument name="format" type="String" required="true" >
<cfargument name="options" type="Struct" required="false" default="#StructNew()#" >
<cfargument name="prefix" type="string" required="false" default="" >
<cfset var request = "http://#arguments.prefix#twitter.com/#arguments.method#.#arguments.format#" >
<cfset var key = "" >
<cfset var values = "" >
<cfloop collection="#arguments.options#" item="key">
<cfset values = ListAppend(values,'#lcase(key)#=#arguments.options[key]#','&') >
</cfloop>
<cfset request = "#request#?#values#" >
<cfreturn request >
</cffunction>
|
|||||||||||||||||||||||||||||
| createBlock |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="createBlock" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('blocks/create/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| createFavorite |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="createFavorite" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('favorites/create/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| createFriendship |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="createFriendship" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true">
<cfargument name="follow" type="boolean" required="false" default="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['follow'] = arguments.follow >
<cfset uri = buildURL('friendships/create/#arguments.id#', arguments.format,options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| createList |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="createList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="name,mode,description" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true,true) >
</cffunction>
|
|||||||||||||||||||||||
| deleteList |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="deleteList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = structnew() >
<cfset options["_method"]="DELETE" >
<cfset uri = buildURL('1/#arguments.user#/lists/#arguments.list#',arguments.format,options,"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| deleteMemberList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="deleteMemberList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="member" type="string" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = Structnew() >
<cfset options["_method"]="DELETE" >
<cfset options["id"]=arguments.member >
<cfset uri = buildURL('1/#arguments.user#/#arguments.list#/members',arguments.format,options,"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| destroyBlock |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="destroyBlock" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('blocks/destroy/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| destroyFavorite |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="destroyFavorite" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('favorites/destroy/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| destroyFriendship |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="destroyFriendship" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('friendships/destroy/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| destroyMessage |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="destroyMessage" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('direct_messages/destroy/#arguments.id#',arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| destroyStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="destroyStatus" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/destroy/#arguments.id#',arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| endSession |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="endSession" access="public" output="false" returntype="string">
<cfargument name="format" type="string" default="json" required="false" >
<cfset var uri = buildURL('account/end_session', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||
| execute |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="execute" access="private" returntype="string">
<cfargument name="uri" type="String" required="true" >
<cfargument name="require_credentials" type="Boolean" required="false" default="false" >
<cfargument name="http_post" type="Boolean" required="false" default="false" >
<cfargument name="path" type="string" required="false" default="" >
<cfset var contentFile = "Connection Timeout" >
<cfset var methodType = 'get' >
<cfset var pass = '' >
<cfset var user = '' >
<cfif isConnectionOpen()>
<cfif arguments.http_post>
<cfset methodType = 'post' >
</cfif>
<cfif arguments.require_credentials>
<cfset pass = password >
<cfset user = screenname >
</cfif>
<cftry>
<cfhttp username="#user#" password="#pass#" timeout="5" method="#methodType#" resolveURL="yes" url="#arguments.uri#">
<cfif methodType eq 'post'>
<cfhttpparam type="formfield" name="source" value="cftwitterlib">
<cfif Len(Trim(arguments.path)) >
<cfhttpparam type="file" name="image" file="#arguments.path#">
</cfif>
</cfif>
</cfhttp>
<cfset http_status = ListFirst(cfhttp.StatusCode, ' ') >
<cfset last_api_call = arguments.uri >
<cfset contentFile = cfhttp.Filecontent >
<cfset remaining_hits = remaining_hits - 1 >
<cfcatch type="coldfusion.runtime.RequestTimedOutException">
<cfset http_status = 401 >
<cfset remaining_hits = 0 >
<cfset reset_time= dateAdd("h",1,now()) >
</cfcatch>
</cftry>
</cfif>
<cfreturn contentFile >
</cffunction>
|
|||||||||||||||||||||||||||||
| follow |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="follow" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('notifications/follow/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| friendshipExists |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="friendshipExists" access="public" output="false" returntype="string">
<cfargument name="user_a" type="String" required="true" >
<cfargument name="user_b" type="String" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['user_a'] = arguments.user_a >
<cfset options['user_b'] = arguments.user_b >
<cfset uri = buildURL('friendships/exists', arguments.format,options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getFavorites |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="getFavorites" access="public" output="false" returntype="string">
<cfargument name="id" type="string" default="" required="false" >
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" default="json" required="false" >
<cfset var uri = "" >
<cfif Len(Trim(arguments.id))>
<cfset uri = buildURL('favorites/#arguments.id#', arguments.format) >
<cfelse>
<cfset uri = buildURL('favorites', arguments.format) >
</cfif>
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getFollowerIDs |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getFollowerIDs" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('followers/ids', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getFollowers |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getFollowers" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/followers', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getFriendIDs |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getFriendIDs" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('friends/ids', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getFriends |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getFriends" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/friends', arguments.format,arguments.options) >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| getFriendsTimeline |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getFriendsTimeline" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/friends_timeline', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getHomeTimeline |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getHomeTimeline" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" default="#structnew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/home_timeline',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| getHourly_limit |
![]() |
Returns
|
||||
Show code
<cffunction name="getHourly_limit" access="public" output="false" returntype="numeric">
<cfreturn hourly_limit>
</cffunction>
|
|||||
| getList |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="getList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists/#arguments.list#',arguments.format,Structnew(),"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getLists |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="getLists" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getListsSubscriber |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="getListsSubscriber" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset uri = buildURL('1/#arguments.user#/#arguments.list#/subscribers',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| getListSubscriber |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="getListSubscriber" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,user,id" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/#arguments.list#/subscribers',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| getMemberList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="getMemberList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset uri = buildURL('1/#arguments.user#/#arguments.list#/members',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| getMembershipsList |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="getMembershipsList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists/memberships',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getMembersList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="getMembersList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/#arguments.list#/members',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| getMentions |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getMentions" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/mentions', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getMessages |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getMessages" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('direct_messages', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getPublicTimeline |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="getPublicTimeline" access="public" output="false" returntype="string">
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/public_timeline', arguments.format) >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||
| getRemaining_hits |
![]() |
Returns
|
||||
Show code
<cffunction name="getRemaining_hits" access="public" output="false" returntype="numeric">
<cfreturn remaining_hits>
</cffunction>
|
|||||
| getReplies |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getReplies" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/replies', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getReset_time |
![]() |
Returns
|
||||
Show code
<cffunction name="getReset_time" access="public" output="false" returntype="date">
<cfreturn reset_time>
</cffunction>
|
|||||
| getSentMessages |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getSentMessages" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('direct_messages/sent', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getStatus" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/show/#arguments.id#',arguments.format) >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| getStatusList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="getStatusList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="since_id,max_id,per_page,page" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists/#arguments.list#/statuses',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| getSubscriptionsList |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="getSubscriptionsList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists/subscriptions',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||||||||
| getTrends |
![]() |
Returns
|
||||
Show code
<cffunction name="getTrends" access="public" output="false" returntype="string">
<cfreturn execute("http://search.twitter.com/trends.json") >
</cffunction>
|
|||||
| getTrendsCurrent |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="getTrendsCurrent" access="public" output="false" returntype="string">
<cfargument name="exclude" default="true" required="false" type="boolean" >
<cfset var excludetag = "" / >
<cfif arguments.exclude>
<cfset excludetag = "?exclude=hashtags" / >
</cfif>
<cfreturn execute("http://search.twitter.com/trends/current.json#excludetag#") >
</cffunction>
|
|||||||||||
| getTrendsDaily |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="getTrendsDaily" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfset var uri = buildURL('trends/daily', 'json',arguments.options,'search.') >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||
| getTrendsWeekly |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="getTrendsWeekly" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfset var uri = buildURL('trends/weekly', 'json',arguments.options,'search.') >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||
| getUserid |
![]() |
Returns
|
||||
Show code
<cffunction name="getUserid" access="public" output="false" returntype="string">
<cfset var temp = '' >
<cfif Not Len(Trim(userid))>
<cfset setUserid(screenname) >
</cfif>
<cfreturn userid>
</cffunction>
|
|||||
| getUsername |
![]() |
Returns
|
||||
Show code
<cffunction name="getUsername" access="public" output="false" returntype="string">
<cfreturn screenname>
</cffunction>
|
|||||
| getUserTimeline |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="getUserTimeline" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" default="#StructNew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('statuses/user_timeline', arguments.format,arguments.options) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| getVersion |
![]() |
Returns
|
||||
Show code
<cffunction name="getVersion" access="public" output="false" returntype="string">
<cfreturn "7.0" >
</cffunction>
|
|||||
| init |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="init" access="public" returntype="Twitter">
<cfargument name="username" type="String" required="true" >
<cfargument name="pass" type="String" required="true" >
<cfset Variables.http_status = 401 >
<cfset Variables.last_api_call = "">
<cfset Variables.application_source = "cftwitterlib">
<cfset Variables.screenname = arguments.username>
<cfset Variables.password = arguments.pass>
<cfset Variables.version = "9.0">
<cfset Variables.My = StructNew()>
<cfset Variables.currentStatus = 'initialized'>
<cfset Variables.nextResetHits = DateAdd('h',1,now())>
<cfset setRealRemainingHits()>
<cfset setUserid(arguments.username)>
<cfreturn this >
</cffunction>
|
|||||||||||||||||
| isConnectionOpen |
![]() |
Returns
|
||||
Show code
<cffunction name="isConnectionOpen" access="private" returntype="boolean">
<cfset var ret = true>
<cfset Variables.currentStatus = 'active'>
<cfif Variables.remaining_hits lt 1 >
<cfif DateDiff('h',Variables.nextResetHits,now()) gt 0 >
<cfset Variables.nextResetHits = DateAdd('h',1,now())>
<cfset setRealRemainingHits() >
<cfif Variables.remaining_hits lt 1 >
<cfset Variables.currentStatus = 'limit hits exceeded' >
<cfset ret = false >
</cfif>
<cfelse>
<cfset Variables.currentStatus = 'limit hits exceeded' >
<cfset ret = false >
</cfif>
<cfelse>
<cfset Variables.remaining_hits=Variables.remaining_hits-1>
</cfif>
<cfreturn ret>
</cffunction>
|
|||||
| isTweet |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="isTweet" access="public" output="false" returntype="boolean">
<cfargument name="str" type="string" required="false" default="json" >
<cfif not Len(Trim(arguments.str)) or arguments.str contains "Connection Timeout" or arguments.str contains "Over capacity">>
<cfreturn false>
</cfif>
<cfreturn true>
</cffunction>
|
|||||||||||
| lastAPICall |
![]() |
Returns
|
||||
Show code
<cffunction name="lastAPICall" access="public" output="false" returntype="string">
<cfreturn last_api_call >
</cffunction>
|
|||||
| lastStatusCode |
![]() |
Returns
|
||||
Show code
<cffunction name="lastStatusCode" access="public" output="false" returntype="numeric">
<cfreturn http_status >
</cffunction>
|
|||||
| leave |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="leave" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('notifications/leave/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| newMessage |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="newMessage" access="public" output="false" returntype="string">
<cfargument name="user" type="String" required="true" >
<cfargument name="text" type="String" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['user'] = arguments.user >
<cfset options['text'] = arguments.text >
<cfset uri = buildURL('direct_messages/new', arguments.format,options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| putMembersList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="putMembersList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,cursor" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/#arguments.list#/members',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true,true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| putSubscribers |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="putSubscribers" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset uri = buildURL('1/#arguments.user#/#arguments.list#/subscribers',arguments.format,structnew(),"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| rateLimitStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="rateLimitStatus" access="public" output="false" returntype="string">
<cfargument name="allusers" type="boolean" default="true" required="false" >
<cfargument name="format" type="string" default="json" required="false" >
<cfset var uri = buildURL('account/rate_limit_status', arguments.format) >
<cfreturn execute(uri, arguments.allusers) >
</cffunction>
|
|||||||||||||||||
| reportingSpam |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="reportingSpam" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('report_spam', arguments.format, arguments.options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| retweetsByMeStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="retweetsByMeStatus" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" default="#structnew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/retweeted_by_me',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| retweetsOfMeStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="retweetsOfMeStatus" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" default="#structnew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/retweets_of_me',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| retweetsStatus |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="retweetsStatus" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="options" type="struct" default="#structnew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/retweets/#arguments.id#',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| retweetStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="retweetStatus" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/retweet/#arguments.id#',arguments.format,structnew(),"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| retweetsToMeStatus |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="retweetsToMeStatus" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" default="#structnew()#" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/statuses/retweeted_to_me',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| search |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="search" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfargument name="format" type="string" required="false" default="atom" >
<cfset var uri = buildURL('search', arguments.format,arguments.options,'search.') >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| searchesCreate |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="searchesCreate" access="public" output="false" returntype="string">
<cfargument name="query" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "">
<cfset var options = StructNew() >
<cfset options['query'] = arguments.query >
<cfset var uri = buildURL('saved_searches/create', arguments.format,options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| searchesDestroy |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="searchesDestroy" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('saved_searches/destroy/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| searchesSaved |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="searchesSaved" access="public" output="false" returntype="string">
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('saved_searches', arguments.format) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||
| searchesShow |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="searchesShow" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('saved_searches/show/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| searchUser |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="searchUser" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/users/search', arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| setRealRemainingHits |
![]() |
Returns
|
||||
Show code
<cffunction name="setRealRemainingHits" access="private" returntype="void"> <cfhttp url='http://twitter.com/account/rate_limit_status.json' /> <cfset Struct = DeserializeJSON(cfhttp.FileContent)> <cfset Variables.reset_time = CreateODBCDateTime(Struct.reset_time)> <cfset Variables.remaining_hits = Struct.remaining_hits> </cffunction> |
|||||
| setUserid |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="setUserid" access="private" output="false" returntype="void">
<cfargument name="username" type="String" required="true" >
<cfset var temp = '' >
<cftry>
<cfset temp = xmlparse(showUser(username,'xml')) >
<cfif StructKeyExists(temp,'user')>
<cfset userid = temp.user.id.xmltext >
</cfif>
<cfcatch type="coldfusion.xml.XmlProcessException">
</cfcatch>
</cftry>
</cffunction>
|
|||||||||||
| showFriendship |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="showFriendship" access="public" output="false" returntype="string">
<cfargument name="options" type="struct" required="true">
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('friendships/show', arguments.format,arguments.options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| showUser |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="showUser" access="public" output="false" returntype="string">
<cfargument name="screen_name" type="string" required="false" default="#getUsername()#" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = '' >
<cfset var option = StructNew() >
<cfset option['screen_name'] = arguments.screen_name >
<cfset uri = buildURL('users/show', arguments.format,option) >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| showUserById |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="showUserById" access="public" output="false" returntype="string">
<cfargument name="user_id" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = '' >
<cfset var option = StructNew() >
<cfset option['user_id'] = arguments.user_id >
<cfset uri = buildURL('users/show', arguments.format,option) >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| test |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="test" access="public" output="false" returntype="string">
<cfargument name="id" type="string" required="true" >
<cfargument name="format" type="string" default="json" required="false" >
<cfset var uri = buildURL('help/test/#arguments.id#', arguments.format) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||||||||
| trendsAvailable |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="trendsAvailable" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/trends/available', arguments.format,arguments.options,"api.") >
<cfreturn execute(uri) >
</cffunction>
|
|||||||||||||||||
| trendsLocation |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="trendsLocation" access="public" output="false" returntype="string">
<cfargument name="woeid" type="numeric" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/trends/#arguments.woeid#', arguments.format,StructNew(),"api.") >
<cfreturn execute(uri,true) >
</cffunction>
|
|||||||||||||||||
| unSubscribersList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="unSubscribersList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="keys list_id,user" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset arguments.options["_method"]="DELETE" >
<cfset uri = buildURL('1/#arguments.user#/#arguments.list#/subscribers',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| updateDeliveryDevice |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="updateDeliveryDevice" access="public" output="false" returntype="string">
<cfargument name="device" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['device'] = arguments.device >
<cfset uri = buildURL('account/update_delivery_advice', arguments.format,options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| updateList |
![]() |
Parameters
|
||||||||||||||||||||||||||||
Show code
<cffunction name="updateList" access="public" output="false" returntype="string">
<cfargument name="user" type="string" >
<cfargument name="list" type="string" >
<cfargument name="options" type="struct" default="#structnew()#" hint="name,mode,description" required="false" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('1/#arguments.user#/lists/#arguments.list#',arguments.format,arguments.options,"api.") >
<cfreturn execute(uri, true,true) >
</cffunction>
|
|||||||||||||||||||||||||||||
| updateProfile |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="updateProfile" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('account/update_profile', arguments.format,arguments.options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| updateProfileColors |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="updateProfileColors" access="public" output="false" returntype="string">
<cfargument name="options" type="Struct" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('account/update_profile_colors', arguments.format,arguments.options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||
| updateProfileImage |
![]() |
Parameters
|
||||||||||||||||
Show code
<cffunction name="updateProfileImage" access="public" output="false" returntype="string">
<cfargument name="path" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = buildURL('account/update_profile_image', arguments.format) >
<cfreturn execute(uri, true, true,arguments.path) >
</cffunction>
|
|||||||||||||||||
| updateProfileImageBackground |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="updateProfileImageBackground" access="public" output="false" returntype="string">
<cfargument name="path" type="string" required="true" >
<cfargument name="title" type="string" required="true" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['title'] = arguments.title >
<cfset uri = buildURL('account/update_profile_background_image', arguments.format,options) >
<cfreturn execute(uri, true, true,arguments.path) >
</cffunction>
|
|||||||||||||||||||||||
| updateStatus |
![]() |
Parameters
|
||||||||||||||||||||||
Show code
<cffunction name="updateStatus" access="public" output="true" returntype="string">
<cfargument name="status" type="string" required="true" >
<cfargument name="in_reply_to_status_id" type="string" required="false" default="" >
<cfargument name="format" type="string" required="false" default="json" >
<cfset var uri = "" >
<cfset var options = StructNew() >
<cfset options['status'] = URLEncodedFormat(arguments.status) >
<cfif Len(Trim(arguments.in_reply_to_status_id))>
<cfset options['in_reply_to_status_id'] = arguments.in_reply_to_status_id >
</cfif>
<cfset uri = buildURL('statuses/update', arguments.format,options) >
<cfreturn execute(uri, true, true) >
</cffunction>
|
|||||||||||||||||||||||
| verifyCredentials |
![]() |
Parameters
|
||||||||||
Show code
<cffunction name="verifyCredentials" access="public" output="false" returntype="string">
<cfargument name="format" type="string" default="json" required="false" >
<cfset var uri = buildURL('account/verify_credentials', arguments.format) >
<cfreturn execute(uri, true) >
</cffunction>
|
|||||||||||