/
monkehTweet.cfc
1454 lines (1270 loc) · 168 KB
/
monkehTweet.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!---
Name: monkehTweet.cfc
Author: Matt Gifford AKA coldfumonkeh (http://www.mattgifford.co.uk)
Date: 30.01.2010
Copyright 2010 Matt Gifford AKA coldfumonkeh. All rights reserved.
Product and company names mentioned herein may be
trademarks or trade names of their respective owners.
Subject to the conditions below, you may, without charge:
Use, copy, modify and/or merge copies of this software and
associated documentation files (the 'Software')
Any person dealing with the Software shall not misrepresent the source of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================
Got a lot out of this package? Saved you time and money?
Share the love and visit Matt's wishlist: http://www.amazon.co.uk/wishlist/B9PFNDZNH4PY
Revision history
================
10/09/2010 - Version 1.2
- added OAuth authentication, dealing with HMAC-SHA1 encryption
- revised complete method list to update the available API functions and amended arguments
- removed deprecated methods
- amended underlying architecture of the package (although public-facing methods remain the same for consistency)
- poured blood, sweat and tears (including numerous cups of coffee) into this.
21/09/2010 - Version 1.2.4
- amended issue with incorrect argument names in deleteStatus() and retweet() methods
11/04/2011 - Version 1.2.5
- additional methods added
- getRetweets()
- retweetedBy()
- retweetedByIDs()
- geoSearch()
- geoSimilarPlaces()
- addMemberToList()
- deleteListMember()
- resolved minor authentication issues with getUserTimeline() and friendshipExists() methods
- revised spelling mistake in geoReverseGeocode() method name
01/05/2011 - Version 1.2.6
- additional method added
- search()
10/06/2011 - Version 1.2.7
- resolved issue with getUserTimeline() 401 error
29/06/2011 - Version 1.2.8
- revised error handling and message return information (thanks to Joel (cajunjoel)) for the enhancement request.
08/08/2011 - Version 1.2.9
- rate limit through authenticated requests issues resolved with revision of request handling and parameters being sent in URL query string
- addition of checkHeader argument to the majority of functions to assist in debugging headers
Thanks to Gary Stanton and Ray Majoran for finding the issue with the rate limits on authenticated requests.
22/11/2011 - Version 1.3
- addition of new arguments and parameters to many of the functions to keep inline with Twitter documentation and updates
- resolved a minor issue in the search method to allow for hashtag searching. Thanks to Andrew Myers for finding that one.
- removed deprecated methods - Please check https://dev.twitter.com/docs/api#deprecated to see what has been removed and which function to now use instead
- organisation of methods and functions to enable quicker updates and maintenance for future revisions
- inclusion of (amongst others) the update_with_media function to send a photo / image as part of the status update
=====
NOTE:
Some argument names have been changed in the 1.3 release to match the native counterparts.
Please check your argument names and amend if required.
=====
05/01/2012 - Version 1.3.1
- addition of @Anywhere functionality for front-end enhancements (hovercards, linkifying users, tweet box and authentication login)
28/05/2012 - Version 1.3.2
- addition of new functions:
- getOEmbed (GET statuses/oembed) to return information allowing the creation of an embedded representation of a Tweet on third party sites
- destoryAllListMembers (POST lists/members/destroy_all) to remove multiple members from a list, by specifying a comma-separated list of member ids or screen names.
26/10/2012 - Version 1.4.0
- changed to API v1.1
- getAllLists method endpoint changed from lists/all to lists/list
- ALL methods now go through the authentication process, as required in the v1.1 documentation
- ALL methods now return JSON format only (no more XML). Make sure to update your applications accordingly if you use XML.
- DELETED a butt-load (official terminology) of methods that have been removed / deprecated in v1.1 API.
27/01/2014 - Version 1.4.4
- addition of the following methods:
- getRetweeterIDs
- getRetweetsOfMe
- getFriendsNoRetweetsIDs
- getFriendsList
- getFollowersList
- getListOwnerships
- fixed endpoint for reportSpam() method
26/03/2014 - Version 1.4.5
- fixed an issue with the geo functions that were passing to a non-existant request method as they now need authentication. Thanks to Allan Schumann for finding this.
--->
<cfcomponent output="false" displayname="monkehTweet" hint="I am the main facade / service object for the twitter api." extends="base">
<cfproperty name="authDetails" type="any" default="" />
<cfset variables.instance = structNew() />
<cffunction name="init" access="public" output="false" returntype="any" hint="I am the constructor method for the monkehTweet object.">
<cfargument name="consumerKey" required="true" type="string" default="" hint="The consumer key generated by Twitter for the oAuth." />
<cfargument name="consumerSecret" required="true" type="string" default="" hint="The consumer secret generated by Twitter for the oAuth." />
<cfargument name="oauthToken" required="false" type="string" default="" hint="The access token (oauth_token) generated by Twitter for the oAuth." />
<cfargument name="oauthTokenSecret" required="false" type="string" default="" hint="The access token secret (oauth_token_secret) generated by Twitter for the oAuth." />
<cfargument name="userAccountName" required="false" type="string" default="" hint="The account name for the user. This is needed to access certain methods, including list-related functions." />
<cfargument name="parseResults" required="false" type="boolean" default="false" hint="A boolean value to determine if the output data is parsed or returned as a string" />
<cfscript>
setAuthDetails(
consumerKey = arguments.consumerKey,
consumerSecret = arguments.consumerSecret,
oauthToken = arguments.oauthToken,
oauthTokenSecret = arguments.oauthTokenSecret,
userAccountName = arguments.userAccountName
);
setParseResults(arguments.parseResults);
super.init(getAuthDetails(),arguments.parseResults);
</cfscript>
<cfreturn this />
</cffunction>
<!--- MUTATORS --->
<cffunction name="setAuthDetails" access="private" output="false" hint="I set the twitter account access details">
<cfargument name="consumerKey" required="true" type="string" hint="The consumer key generated by Twitter for the oAuth." />
<cfargument name="consumerSecret" required="true" type="string" hint="The consumer secret generated by Twitter for the oAuth." />
<cfargument name="oauthToken" required="false" type="string" default="" hint="The access token (oauth_token) generated by Twitter for the oAuth." />
<cfargument name="oauthTokenSecret" required="false" type="string" default="" hint="The access token secret (oauth_token_secret) generated by Twitter for the oAuth." />
<cfargument name="userAccountName" required="false" type="string" default="" hint="The account name for the user. This is needed to access certain methods, including list-related functions." />
<cfset variables.instance.authDetails = createObject('component', 'authDetails')
.init(argumentCollection=arguments) />
</cffunction>
<cffunction name="setParseResults" access="private" output="false" hint="I set the parseResult boolean value">
<cfargument name="parseResults" required="false" default="false" type="boolean" hint="A boolean value to determine if the output data is parsed or returned as a string" />
<cfset variables.instance.parseResults = arguments.parseResults />
</cffunction>
<!--- ACCESSORS --->
<cffunction name="getAuthDetails" access="public" output="false" hint="I get the twitter account access details">
<cfreturn variables.instance.authDetails />
</cffunction>
<cffunction name="getParseResults" access="public" output="false" returntype="boolean" hint="I set the parseResult boolean value">
<cfreturn variables.instance.parseResults />
</cffunction>
<!--- PUBLIC METHODS --->
<cffunction name="setFinalAccessDetails" access="public" output="false" hint="I set the value of the oauthToken, oauthTokenSecret and authenticated user's screenname after a successful authentication.">
<cfargument name="oauthToken" required="true" type="string" hint="The access token (oauth_token) generated by Twitter for the oAuth." />
<cfargument name="oauthTokenSecret" required="true" type="string" hint="The access token secret (oauth_token_secret) generated by Twitter for the oAuth." />
<cfargument name="userAccountName" required="true" type="string" hint="The account name for the user. This is needed to access certain methods, including list-related functions." />
<cfscript>
variables.instance.authDetails.setOAuthToken(arguments.oauthToken);
variables.instance.authDetails.setOAuthTokenSecret(arguments.oauthTokenSecret);
variables.instance.authDetails.setUserAccountName(arguments.userAccountName);
</cfscript>
</cffunction>
<!--- Timelines --->
<!--- Timelines are collections of Tweets, ordered with the most recent first. --->
<!--- GET statuses/mentions_timeline --->
<cffunction name="getMentions" access="public" output="false" hint="Returns the 20 most recent mentions (status containing @username) for the authenticating user.">
<cfargument name="count" required="false" default="" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only statuses with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="trim_user" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object." />
<cfargument name="contributor_details" required="false" default="" type="string" hint="This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included." />
<cfargument name="include_entities" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the headers and sent information for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/mentions_timeline.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/user_timeline --->
<cffunction name="getUserTimeline" access="public" output="false" hint="Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter. This is the equivalent of the Web /<user> page for your own user, or the profile page for a third party.">
<cfargument name="user_id" required="false" default="" type="string" hint="Specfies the ID of the user for whom to return the user_timeline. Helpful for disambiguating when a valid user ID is also a valid screen name. " />
<cfargument name="screen_name" required="false" default="" type="string" hint="Specfies the screen name of the user for whom to return the user_timeline. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only statuses with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="count" required="false" default="" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="trim_user" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object." />
<cfargument name="exclude_replies" required="false" default="" type="string" hint="This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies." />
<cfargument name="contributor_details" required="false" default="" type="string" hint="This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included." />
<cfargument name="include_rts" required="false" default="" type="string" hint="When set to either true, t or 1,the timeline will contain native retweets (if they exist) in addition to the standard stream of tweets. The output format of retweeted tweets is identical to the representation you see in home_timeline. Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will still contain a full user object." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = '' />
<cfscript>
// Conditional discrepancy found by @aqlong - Thanks, Aaron!
if(!len(arguments.screen_name) AND !len(arguments.user_id)) {
arguments.screen_name = getAuthDetails().getUserAccountName();
}
strTwitterMethod = getCorrectEndpoint('api') & 'statuses/user_timeline.json';
</cfscript>
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/home_timeline --->
<cffunction name="getHomeTimeline" access="public" output="false" hint="Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web. Usage note: This home_timeline is identical to statuses/friends_timeline except it also contains retweets, which statuses/friends_timeline does not (for backwards compatibility reasons).">
<cfargument name="count" required="false" default="" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only statuses with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="trim_user" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object." />
<cfargument name="exclude_replies" required="false" default="" type="string" hint="This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies." />
<cfargument name="contributor_details" required="false" default="" type="string" hint="This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included." />
<cfargument name="include_entities" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/home_timeline.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/retweets_of_me --->
<cffunction name="getRetweetsOfMe" access="public" output="false" hint="Returns the most recent tweets authored by the authenticating user that have been retweeted by others. This timeline is a subset of the user's GET statuses/user_timeline.">
<cfargument name="count" required="false" default="" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only statuses with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="trim_user" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object." />
<cfargument name="exclude_replies" required="false" default="" type="string" hint="This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies." />
<cfargument name="contributor_details" required="false" default="" type="string" hint="This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included." />
<cfargument name="include_entities" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future." />
<cfargument name="include_user_entities" required="false" default="" type="string" hint="The user entities node will be disincluded when set to false." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/retweets_of_me.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Timelines --->
<!--- Tweets --->
<!--- Tweets are the atomic building blocks of Twitter, 140-character status updates with additional associated metadata. People tweet for a variety of reasons about a multitude of topics. --->
<!--- GET statuses/retweets/:id --->
<cffunction name="getRetweets" access="public" output="false" hint="Returns up to 100 of the first retweets of a given tweet.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the desired status." />
<cfargument name="count" required="false" type="Numeric" default="100" hint="Specifies the number of records to retrieve. must be less than or equal to 100." />
<cfargument name="trim_user" required="false" type="Boolean" default="false" hint="When set to true, each tweet returned in a timeline will include a user object including ONLY the status author's numerical ID, otherwise you will receive the complete user object." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/retweets/' & arguments.id & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/show/:id --->
<cffunction name="getStatusByID" access="public" output="false" hint="Returns a single status, specified by the id parameter below. The status's author will be returned inline.">
<cfargument name="id" required="true" type="String" hint="I am the numerical ID of the desired status." />
<cfargument name="trim_user" required="false" type="Boolean" default="false" hint="When set to true, each tweet returned in a timeline will include a user object including ONLY the status author's numerical ID, otherwise you will receive the complete user object." />
<cfargument name="include_my_retweet" required="false" type="Boolean" default="false" hint="When set to true, any Tweets returned that have been retweeted by the authenticating user will include an additional current_user_retweet node, containing the ID of the source status for the retweet." />
<cfargument name="include_entities" required="false" type="Boolean" default="false" hint="The entities node will be disincluded when set to false." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/show/' & arguments.id & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST statuses/destroy/:id --->
<cffunction name="deleteStatus" access="public" output="false" hint="Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.">
<cfargument name="id" required="true" type="string" hint="The ID of the status to destroy." />
<cfargument name="trim_user" required="false" type="Boolean" default="false" hint="When set to true, each tweet returned in a timeline will include a user object including ONLY the status author's numerical ID, otherwise you will receive the complete user object." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/destroy/' & arguments.id & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST statuses/update --->
<cffunction name="postUpdate" access="public" output="false" hint="Updates the authenticating user's status. Request must be a POST. A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.">
<cfargument name="status" required="true" type="String" hint="The text of your status update. URL encode as necessary. Statuses over 140 characters will be forceably truncated." />
<cfargument name="in_reply_to_status_id" required="false" type="String" hint="The ID of an existing status that the update is in reply to." />
<cfargument name="lat" required="false" type="String" hint="The location's latitude that this tweet refers to." />
<cfargument name="long" required="false" type="String" hint="The location's longitude that this tweet refers to." />
<cfargument name="place_id" required="false" type="String" hint="A place in the world. These IDs can be retrieved from geo/reverse_geocode." />
<cfargument name="display_coordinates" required="false" type="String" hint="Whether or not to put a pin on the exact coordinates a tweet has been sent from." />
<cfargument name="trim_user" required="false" type="Boolean" default="false" hint="When set to true, each tweet returned in a timeline will include a user object including ONLY the status author's numerical ID, otherwise you will receive the complete user object." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/update.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST', parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST statuses/retweet/:id --->
<cffunction name="retweet" access="public" output="false" hint="Retweets a tweet. Requires the id parameter of the tweet you are retweeting. Returns the original tweet with retweet details embedded.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the tweet you are retweeting." />
<cfargument name="trim_user" required="false" type="Boolean" default="false" hint="When set to true, each tweet returned in a timeline will include a user object including ONLY the status author's numerical ID, otherwise you will receive the complete user object." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/retweet/' & arguments.id & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST statuses/update_with_media --->
<cffunction name="postUpdateWithMedia" access="public" output="false" hint="Updates the authenticating user's status. Request must be a POST. A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.">
<cfargument name="status" required="true" type="String" hint="The text of your status update. URL encode as necessary. Statuses over 140 characters will be forceably truncated." />
<cfargument name="media" required="true" type="string" hint="Up to max_media_per_upload files may be specified in the request, each named media[]. Supported image formats are PNG, JPG and GIF. Animated GIFs are not supported." />
<cfargument name="possibly_sensitive" required="false" type="boolean" default="false" hint="Set to true for content which may not be suitable for every audience." />
<cfargument name="in_reply_to_status_id" required="false" type="String" hint="The ID of an existing status that the update is in reply to." />
<cfargument name="lat" required="false" type="String" hint="The location's latitude that this tweet refers to." />
<cfargument name="long" required="false" type="String" hint="The location's longitude that this tweet refers to." />
<cfargument name="place_id" required="false" type="String" hint="A place in the world. These IDs can be retrieved from geo/reverse_geocode." />
<cfargument name="display_coordinates" required="false" type="String" hint="Whether or not to put a pin on the exact coordinates a tweet has been sent from." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = '' />
<cfset arguments["media[]"] = arguments.media />
<cfset structDelete(arguments,'media') />
<cfset strTwitterMethod = getCorrectEndpoint('api') & 'statuses/update_with_media.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST', parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/oembed --->
<cffunction name="getOEmbed" access="public" output="false" hint="Returns information allowing the creation of an embedded representation of a Tweet on third party sites. See the oEmbed specification (http://oembed.com/) for information about the response format. While this endpoint allows a bit of customization for the final appearance of the embedded Tweet, be aware that the appearance of the rendered Tweet may change over time to be consistent with Twitter's Display Guidelines. Do not rely on any class or id parameters to stay constant in the returned markup.">
<cfargument name="id" required="false" type="string" default="" hint="The Tweet/status ID to return embed code for." />
<cfargument name="url" required="false" type="string" default="" hint="The URL of the Tweet/status to be embedded." />
<cfargument name="maxwidth" required="false" type="string" hint="The maximum width in pixels that the embed should be rendered at. This value is constrained to be between 250 and 550 pixels. Note that Twitter does not support the oEmbed maxheight parameter. Tweets are fundamentally text, and are therefore of unpredictable height that cannot be scaled like an image or video. Relatedly, the oEmbed response will not provide a value for height. Implementations that need consistent heights for Tweets should refer to the hide_thread and hide_media parameters below." />
<cfargument name="hide_media" required="false" type="string" hint="Specifies whether the embedded Tweet should automatically expand images which were uploaded via POST statuses/update_with_media. When set to either true, t or 1 images will not be expanded. Defaults to false." />
<cfargument name="hide_thread" required="false" type="string" hint="Specifies whether the embedded Tweet should automatically show the original message in the case that the embedded Tweet is a reply. When set to either true, t or 1 the original Tweet will not be shown. Defaults to false." />
<cfargument name="omit_script" required="false" type="string" hint="Specifies whether the embedded Tweet HTML should include a <script> element pointing to widgets.js. In cases where a page already includes widgets.js, setting this value to true will prevent a redundant script element from being included. When set to either true, t or 1 the <script> element will not be included in the embed HTML, meaning that pages must include a reference to widgets.js manually. Defaults to false." />
<cfargument name="align" required="false" type="string" hint="Specifies whether the embedded Tweet should be left aligned, right aligned, or centered in the page. Valid values are left, right, center, and none. Defaults to none, meaning no alignment styles are specified for the Tweet." />
<cfargument name="related" required="false" type="string" hint="A value for the TWT related parameter, as described in Web Intents. This value will be forwarded to all Web Intents calls. Examples: twitterapi,twittermedia,twitter." />
<cfargument name="lang" required="false" type="string" hint="Language code for the rendered embed. This will affect the text and localization of the rendered HTML. Examples: fr." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/oembed.json?' & buildParamString(arguments) />
<cfif !len(arguments.id) AND !len(arguments.url)>
<cfabort showerror="Please supply either an id or a URL of the Tweet you wish to embed." />
</cfif>
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET', parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET statuses/retweeters/ids --->
<cffunction name="getRetweeterIDs" access="public" output="false" hint="Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter. This method offers similar data to GET statuses/retweets/:id and replaces API v1's GET statuses/:id/retweeted_by/ids method.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the desired status." />
<cfargument name="cursor" required="false" type="string" default="-1" hint="Causes the list of IDs to be broken into pages of no more than 100 IDs at a time. The number of IDs returned is not guaranteed to be 100 as suspended users are filterd out after connections are queried. To begin paging provide a value of -1 as the cursor. The response from the API will include a previous_cursor and next_cursor to allow paging back and forth." />
<cfargument name="stringify_ids" required="false" type="boolean" default="false" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'statuses/retweeters/ids.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Tweets --->
<!--- Search --->
<!--- Find relevant Tweets based on queries performed by your users. --->
<!--- GET search/tweets --->
<cffunction name="search" access="public" output="false" hint="Returns tweets that match a specified query.">
<cfargument name="q" required="true" type="String" hint="Search query. Should be URL encoded. Queries will be limited by complexity." />
<cfargument name="geocode" required="false" type="String" hint="Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by 'latitude,longitude,radius', where radius units must be specified as either 'mi' (miles) or 'km' (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly." />
<cfargument name="lang" required="false" type="String" hint="Restricts tweets to the given language, given by an ISO 639-1 code." />
<cfargument name="locale" required="false" type="String" hint="Specify the language of the query you are sending (only ja is currently effective). This is intended for language-specific clients and the default should work in the majority of cases." />
<cfargument name="result_type" required="false" default="mixed" type="String" hint="Optional. Specifies what type of search results you would prefer to receive. The current default is 'mixed.' Valid values include: mixed: Include both popular and real time results in the response. recent: return only the most recent results in the response popular: return only the most popular results in the response. http://search.twitter.com/search.json?result_type=mixed http://search.twitter.com/search.json?result_type=recent http://search.twitter.com/search.json?result_type=popular" />
<cfargument name="count" required="false" type="String" hint="The number of tweets to return per page, up to a max of 100." />
<cfargument name="until" required="false" type="String" hint="Optional. Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD." />
<cfargument name="since_id" required="false" type="String" hint="Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="include_entities" required="false" default="true" type="String" hint="Optional. When set to either true, t or 1, each tweet will include a node called 'entities,'. This node offers a variety of metadata about the tweet in a discreet structure, including: urls, media and hashtags. Note that user mentions are currently not supported for search and there will be no 'user_mentions' key in the entities map." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'search/tweets.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End of Search --->
<!--- Direct Messages --->
<!--- Direct Messages are short, non-public messages sent between two users. Access to Direct Messages is governed by the The Application Permission Model. --->
<!--- GET direct_messages --->
<cffunction name="getDirectMessages" access="public" output="false" returntype="Any" hint="Returns a list of the 20 most recent direct messages sent to the authenticating user. The XML and JSON versions include detailed information about the sending and recipient users.">
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only direct messages with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="count" required="false" default="200" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="page" required="false" default="" type="string" hint="Specifies the page or results to retrieve." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'direct_messages.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET direct_messages/sent --->
<cffunction name="getDirectMessagesSent" access="public" output="false" returntype="Any" hint="Returns a list of the 20 most recent direct messages sent by the authenticating user. The XML and JSON versions include detailed information about the sending and recipient users.">
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only direct messages with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="count" required="false" default="200" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="page" required="false" default="" t ype="string" hint="Specifies the page or results to retrieve." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'direct_messages/sent.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET direct_messages/show --->
<cffunction name="getDirectMessagesByID" access="public" output="false" returntype="Any" hint="Returns a single direct message, specified by an id parameter. Like the /1/direct_messages.format request, this method will include the user objects of the sender and recipient.">
<cfargument name="id" required="true" default="" type="string" hint="The ID of the direct message." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'direct_messages/show.json?id=' & arguments.id />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST direct_messages/destroy --->
<cffunction name="deleteDM" access="public" output="false" returntype="Any" hint="Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.">
<cfargument name="id" required="true" type="string" hint="The ID of the direct message to destroy." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'direct_messages/destroy.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST direct_messages/new --->
<cffunction name="createDM" access="public" output="false" returntype="Any" hint="Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters. Request must be a POST. Returns the sent message in the requested format when successful.">
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user who should receive the direct message. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="user_id" required="false" type="string" hint="The ID of the user who should receive the direct message. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="text" required="true" type="string" hint="The text of your direct message. Under 140 characters." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'direct_messages/new.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Direct Messages --->
<!--- Friends & Followers --->
<!--- Users follow their interests on Twitter through both one-way and mutual following relationships. --->
<!--- GET friendships/no_retweets/ids --->
<cffunction name="getFriendsNoRetweetsIDs" access="public" output="false" returntype="Any" hint="Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from. Use POST friendships/update to set the 'no retweets' status for a given user account on behalf of the current user.">
<cfargument name="stringify_ids" required="false" default="false" type="boolean" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/no_retweets/ids.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friends/ids --->
<cffunction name="getFriendsIDs" access="public" output="false" returntype="Any" hint="Returns an array of numeric IDs for every user the specified user is following. This method is powerful when used in conjunction with users/lookup.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Causes the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filterd out after connections are queried. To begin paging provide a value of -1 as the cursor. The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. If the cursor is not provided the API will attempt to return all IDs. For users with many connections this will probably fail. Querying without the cursor parameter is deprecated and should be avoided. The API is being updated to force the cursor to be -1 if it isn't supplied." />
<cfargument name="stringify_ids" required="false" default="false" type="boolean" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="count" required="false" default="200" type="string" hint="Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. The value of count is best thought of as a limit to the number of results to return. When using the count parameter with this method, it is wise to use a consistent count value across all requests to the same user's collection. Usage of this parameter is encouraged in environments where all 5,000 IDs constitutes too large of a response." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friends/ids.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET followers/ids --->
<cffunction name="getFollowersIDs" access="public" output="false" returntype="Any" hint="Returns an array of numeric IDs for every user following the specified user. This method is powerful when used in conjunction with users/lookup.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Causes the list of connections to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filterd out after connections are queried. To begin paging provide a value of -1 as the cursor. The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. If the cursor is not provided the API will attempt to return all IDs. For users with many connections this will probably fail. Querying without the cursor parameter is deprecated and should be avoided. The API is being updated to force the cursor to be -1 if it isn't supplied." />
<cfargument name="stringify_ids" required="false" default="false" type="boolean" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="count" required="false" default="200" type="string" hint="Specifies the number of IDs attempt retrieval of, up to a maximum of 5,000 per distinct request. The value of count is best thought of as a limit to the number of results to return. When using the count parameter with this method, it is wise to use a consistent count value across all requests to the same user's collection. Usage of this parameter is encouraged in environments where all 5,000 IDs constitutes too large of a response." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'followers/ids.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friendships/lookup --->
<cffunction name="getFriendshipsLookup" access="public" output="false" returntype="Any" hint="Returns the relationship of the authenticating user to the comma separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none.">
<cfargument name="screen_name" required="false" type="string" hint="A comma separated list of screen names, up to 100 are allowed in a single request." />
<cfargument name="user_id" required="false" type="string" hint="A comma separated list of user IDs, up to 100 are allowed in a single request." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/lookup.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friendships/incoming --->
<cffunction name="getIncomingFriendships" access="public" output="false" returntype="Any" hint="Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.">
<cfargument name="cursor" required="false" type="string" hint="Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list." />
<cfargument name="stringify_ids" required="false" default="false" type="boolean" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/incoming.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friendships/outgoing --->
<cffunction name="getOutgoingFriendships" access="public" output="false" returntype="Any" hint="Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.">
<cfargument name="cursor" required="false" type="string" hint="Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list." />
<cfargument name="stringify_ids" required="false" default="false" type="boolean" hint="Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/outgoing.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST friendships/create --->
<cffunction name="followUser" access="public" output="false" returntype="Any" hint="Allows the authenticating users to follow the user specified in the ID parameter. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="follow" required="false" type="string" hint="Enable notifications for the target user." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/create.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST friendships/destroy --->
<cffunction name="unfollowUser" access="public" output="false" returntype="Any" hint="Allows the authenticating users to unfollow the user specified in the ID parameter. Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/destroy.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST friendships/update --->
<cffunction name="updateFriendships" access="public" output="false" returntype="Any" hint="Allows one to enable or disable retweets and device notifications from the specified user.">
<cfargument name="user_id" required="false" type="string" hint="Specifies the ID of the user to befriend. Helpful for disambiguating when a valid user ID is also a valid screen name. The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="device" required="false" default="false" type="Boolean" hint="Enable/disable device notifications from the target user." />
<cfargument name="retweets" required="false" default="false" type="Boolean" hint="Enable/disable device notifications from the target user." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/update.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friendships/show --->
<cffunction name="showFriendships" access="public" output="false" returntype="Any" hint="Returns detailed information about the relationship between two users.">
<cfargument name="source_id" required="false" type="string" hint="The user_id of the subject user." />
<cfargument name="source_screen_name" required="false" type="string" hint="The screen_name of the subject user." />
<cfargument name="target_id" required="false" type="string" hint="The user_id of the target user." />
<cfargument name="target_screen_name" required="false" type="string" hint="The screen_name of the target user." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friendships/show.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET friends/list --->
<cffunction name="getFriendsList" access="public" output="false" returntype="Any" hint="Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their 'friends'). At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple 'pages' of results can be navigated through using the next_cursor value in subsequent requests. ">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Causes the list of results to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filterd out after connections are queried. To begin paging provide a value of -1 as the cursor. The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. If the cursor is not provided the API will attempt to return all IDs. For users with many connections this will probably fail. Querying without the cursor parameter is deprecated and should be avoided. The API is being updated to force the cursor to be -1 if it isn't supplied." />
<cfargument name="count" required="false" default="20" type="string" hint="The number of users to return per page, up to a maximum of 200. Defaults to 20." />
<cfargument name="skip_status" required="false" type="boolean" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="include_user_entities" required="false" type="boolean" hint="The user object entities node will be disincluded when set to false." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'friends/list.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET followers/list --->
<cffunction name="getFollowersList" access="public" output="false" returntype="Any" hint="Returns a cursored collection of user objects for users following the specified user. At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple 'pages' of results can be navigated through using the next_cursor value in subsequent requests. ">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Causes the list of results to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filterd out after connections are queried. To begin paging provide a value of -1 as the cursor. The response from the API will include a previous_cursor and next_cursor to allow paging back and forth. If the cursor is not provided the API will attempt to return all IDs. For users with many connections this will probably fail. Querying without the cursor parameter is deprecated and should be avoided. The API is being updated to force the cursor to be -1 if it isn't supplied." />
<cfargument name="count" required="false" default="20" type="string" hint="The number of users to return per page, up to a maximum of 200. Defaults to 20." />
<cfargument name="skip_status" required="false" type="boolean" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="include_user_entities" required="false" type="boolean" hint="The user object entities node will be disincluded when set to false." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'followers/list.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Friends & Followers --->
<!--- Users --->
<!--- Users are at the center of everything Twitter: they follow, they favorite, and tweet & retweet. --->
<!--- GET account/settings --->
<cffunction name="getAccountSettings" access="public" output="false" hint="Returns settings (including current trend, geo and sleep time information) for the authenticating user.">
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/settings.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET account/verify_credentials --->
<cffunction name="verifyCredentials" access="public" output="false" returntype="any" hint="Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.">
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/verify_credentials.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST account/settings --->
<cffunction name="updateAccountSettings" access="public" output="false" returntype="any" hint="Updates the authenticating user's settings.">
<cfargument name="trend_location_woeid" required="true" default="" type="string" hint="The Yahoo! Where On Earth ID to use as the user's default trend location. Global information is available by using 1 as the WOEID. The woeid must be one of the locations returned by GET trends/available." />
<cfargument name="sleep_time_enabled" required="false" default="" type="string" hint="When set to true, t or 1, will enable sleep time for the user. Sleep time is the time when push or SMS notifications should not be sent to the user." />
<cfargument name="start_sleep_time" required="false" default="" type="string" hint="The hour that sleep time should begin if it is enabled. The value for this parameter should be provided in ISO8601 format (i.e. 00-23). The time is considered to be in the same timezone as the user's time_zone setting." />
<cfargument name="end_sleep_time" required="false" default="" type="string" hint="The hour that sleep time should end if it is enabled. The value for this parameter should be provided in ISO8601 format (i.e. 00-23). The time is considered to be in the same timezone as the user's time_zone setting." />
<cfargument name="time_zone" required="false" default="" type="string" hint="The timezone dates and times should be displayed in for the user. The timezone must be one of the Rails TimeZone names. Example: Europe/Copenhagen, Pacific/Tongatapu" />
<cfargument name="lang" required="false" default="" type="string" hint="The language which Twitter should render in for this user. The language must be specified by the appropriate two letter ISO 639-1 representation. Currently supported languages are provided by GET help/languages." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/settings.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST account/update_profile --->
<cffunction name="updateProfile" access="public" output="false" returntype="any" hint="Sets values that users are able to set under the 'Account' tab of their settings page. Only the parameters specified will be updated.">
<cfargument name="name" required="false" type="string" hint="Full name associated with the profile. Maximum of 20 characters." />
<cfargument name="url" required="false" type="string" hint="URL associated with the profile. Will be prepended with 'http://' if not present. Maximum of 100 characters." />
<cfargument name="location" required="false" type="string" hint="The city or country describing where the user of the account is located. The contents are not normalized or geocoded in any way. Maximum of 30 characters." />
<cfargument name="description" required="false" type="string" hint="A description of the user owning the account. Maximum of 160 characters." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/update_profile.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST account/update_profile_background_image --->
<cffunction name="updateProfileBackgroundImage" access="public" output="false" returntype="any" hint="Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. Although each parameter is marked as optional, at least one of image, tile or use must be provided when making this request.">
<cfargument name="image" required="false" default="" type="string" hint="The background image for the profile, base64-encoded. Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down. The image must be provided as raw multipart data, not a URL." />
<cfargument name="tile" required="false" default="" type="string" hint="Whether or not to tile the background image. If set to true, t or 1 the background image will be displayed tiled. The image will not be tiled otherwise." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="use" required="false" default="" type="string" hint="Determines whether to display the profile background image or not. When set to true, t or 1 the background image will be displayed if an image is being uploaded with the request, or has been uploaded previously. An error will be returned if you try to use a background image when one is not being uploaded or does not exist. If this parameter is defined but set to anything other than true, t or 1, the background image will stop being used." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/update_profile_background_image.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST account/update_profile_colors --->
<cffunction name="updateProfileColors" access="public" output="false" returntype="any" hint="Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexidecimal value, and may be either three or six characters (ex: ##fff or ##ffffff).">
<cfargument name="profile_background_color" required="false" default="" type="string" hint="Must be a valid hexidecimal value, and may be either three or six characters (ex: fff or ffffff)" />
<cfargument name="profile_link_color" required="false" default="" type="string" hint="Must be a valid hexidecimal value, and may be either three or six characters (ex: fff or ffffff)" />
<cfargument name="profile_sidebar_border_color" required="false" default="" type="string" hint="Must be a valid hexidecimal value, and may be either three or six characters (ex: fff or ffffff)" />
<cfargument name="profile_sidebar_fill_color" required="false" default="" type="string" hint="Must be a valid hexidecimal value, and may be either three or six characters (ex: fff or ffffff)" />
<cfargument name="profile_text_color" required="false" default="" type="string" hint="Must be a valid hexidecimal value, and may be either three or six characters (ex: fff or ffffff)" />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/update_profile_colors.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST account/update_profile_image --->
<cffunction name="updateProfileImage" access="public" output="false" returntype="any" hint="Updates the authenticating user's profile image. Note that this method expects raw multipart data, not a URL to an image. This method asynchronously processes the uploaded file before updating the user's profile image URL. You can either update your local cache the next time you request the user's information, or, at least 5 seconds after uploading the image, ask for the updated URL using GET users/profile_image/:screen_name.">
<cfargument name="image" required="true" default="" type="any" hint="The avatar image for the profile, base64-encoded. Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down. Animated GIFs will be converted to a static GIF of the first frame, removing the animation." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'account/update_profile_colors.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET blocks/list --->
<cffunction name="getBlockedUsers" access="public" output="false" returntype="Any" hint="Returns an array of user objects that the authenticating user is blocking. Consider using GET blocks/blocking/ids with GET users/lookup instead of this method.">
<cfargument name="include_entities" required="false" type="Boolean" default="true" hint="The entities node will not be included when set to false." />
<cfargument name="skip_status" required="false" type="string" default="" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="cursor" required="false" type="string" default="" hint="Causes the list of blocked users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first 'page.' The response from the API will include a previous_cursor and next_cursor to allow paging back and forth." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'blocks/list.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET blocks/ids --->
<cffunction name="getBlockingIDs" access="public" output="false" returntype="Any" hint="Returns a collection of user objects that the authenticating user is blocking.">
<cfargument name="stringify_ids" required="false" type="Boolean" default="false" hint="Many programming environments will not consume our Tweet ids due to their size. Provide this option to have ids returned as strings instead." />
<cfargument name="cursor" required="false" type="string" default="" hint="Causes the list of blocked users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first 'page.' The response from the API will include a previous_cursor and next_cursor to allow paging back and forth." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'blocks/ids.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST blocks/create --->
<cffunction name="blockUser" access="public" output="false" returntype="Any" hint="Blocks the user specified in the ID parameter as the authenticating user. Destroys a friendship to the blocked user if it exists. Returns the blocked user in the requested format when successful">
<cfargument name="user_id" required="false" type="string" hint="The ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" type="string" default="" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'blocks/create.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST blocks/destroy --->
<cffunction name="unblockUser" access="public" output="false" returntype="Any" hint="Un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the potentially blocked user. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the potentially blocked user. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" type="string" default="" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'blocks/destroy.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/lookup --->
<cffunction name="lookupUser" access="public" output="false" returntype="any" hint="Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.">
<cfargument name="user_id" required="false" type="string" hint="A comma separated list of user IDs, up to 100 are allowed in a single request." />
<cfargument name="screen_name" required="false" type="string" hint="A comma separated list of screen names, up to 100 are allowed in a single request." />
<cfargument name="include_entities" required="false" type="Boolean" default="false" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/lookup.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/show --->
<cffunction name="getUserDetails" access="public" output="false" returntype="any" hint="Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Either an id or screen_name is required for this method." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Either a id or screen_name is required for this method." />
<cfargument name="include_entities" required="false" type="Boolean" default="false" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/show.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/search --->
<cffunction name="searchForUser" access="public" output="false" returntype="any" hint="Runs a search for users similar to Find People button on Twitter.com. The results returned by people search on Twitter.com are the same as those returned by this API request. Note that unlike GET search, this method does not support any operators. Only the first 1000 matches are available.">
<cfargument name="q" required="true" type="string" hint="The query to run against people search" />
<cfargument name="page" required="false" default="1" type="string" hint="Specifies the page of results to retrieve." />
<cfargument name="count" required="false" default="20" type="string" hint="The number of potential user results to retrieve per page. This value has a maximum of 20." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/search.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/contributees --->
<cffunction name="getUserContributees" access="public" output="false" returntype="any" hint="Returns an array of users that the specified user can contribute to.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Either an id or screen_name is required for this method." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Either a id or screen_name is required for this method." />
<cfargument name="include_entities" required="false" type="Boolean" default="false" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" type="string" default="" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/contributees.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/contributors --->
<cffunction name="getUserContributers" access="public" output="false" returntype="any" hint="Returns an array of users who can contribute to the specified account.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Either an id or screen_name is required for this method." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Either a id or screen_name is required for this method." />
<cfargument name="include_entities" required="false" type="Boolean" default="false" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" type="string" default="" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/contributors.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Users --->
<!--- Suggested Users --->
<!--- Categorical organization of users that others may be interested to follow. --->
<!--- GET users/suggestions/:slug --->
<cffunction name="getUserSuggestionsInCategory" access="public" output="false" returntype="any" hint="Access the users in a given category of the Twitter suggested user list. It is recommended that end clients cache this data for no more than one hour.">
<cfargument name="slug" required="true" type="String" hint="The short name of list or a category." />
<cfargument name="lang" required="false" type="String" default="en" hint="Restricts the suggested categories to the requested language. The language must be specified by the appropriate two letter ISO 639-1 representation." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/suggestions/' & arguments.slug & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/suggestions --->
<cffunction name="getUserSuggestions" access="public" output="false" returntype="any" hint="Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in GET users/suggestions/:slug to get the users in that category.">
<cfargument name="lang" required="false" type="String" default="en" hint="Restricts the suggested categories to the requested language. The language must be specified by the appropriate two letter ISO 639-1 representation." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'users/suggestions.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET users/suggestions/:slug/members.format --->
<cffunction name="getUserSuggestionsInCategoryWithStatus" access="public" output="false" returntype="any" hint="Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.">
<cfargument name="slug" required="true" type="String" hint="The short name of list or a category." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = '' />
<cfscript>
strTwitterMethod = getCorrectEndpoint('api') & 'users/suggestions' & '/' & arguments.slug;
strTwitterMethod = strTwitterMethod & '/members.json';
</cfscript>
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Suggested Users --->
<!--- Favourites --->
<!--- Users favorite tweets to give recognition to awesome tweets, to curate the best of Twitter, to save for reading later, and a variety of other reasons. Likewise, developers make use of "favs" in many different ways. --->
<!--- GET favorites/list --->
<cffunction name="favorites" access="public" output="false" returntype="Any" hint="Returns the 20 most recent Tweets favorited by the authenticating or specified user.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="count" required="false" default="200" type="string" hint="Specifies the number of statuses to retrieve. May not be greater than 200." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns only direct messages with an ID greater than (that is, more recent than) the specified ID." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns only statuses with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'favorites/list.json?' & buildParamString(arguments) />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments, checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST favorites/destroy --->
<cffunction name="removeFromFavorites" access="public" output="false" returntype="Any" hint="Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the desired status." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset arguments.action = 'destroy' />
<cfreturn handleFavorites(argumentCollection=arguments) />
</cffunction>
<!--- POST favorites/create --->
<cffunction name="addToFavorites" access="public" output="false" returntype="Any" hint="Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the desired status." />
<cfargument name="include_entities" required="false" default="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset arguments.action = 'create' />
<cfreturn handleFavorites(argumentCollection=arguments) />
</cffunction>
<cffunction name="handleFavorites" access="private" output="false" returntype="Any" hint="I am the private method that handles the 'favorites' methods.">
<cfargument name="id" required="true" type="string" hint="The numerical ID of the desired status." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="action" required="true" type="String" hint="I am the action to take on this favorite. CREATE or DESTROY." />
<cfargument name="checkHeader" required="false" type="boolean" default="false" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'favorites/' & arguments.action & '.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- End Favourites --->
<!--- List resources : list-specific methods --->
<!--- Lists are collections of tweets, culled from a curated list of Twitter users. List timeline methods include tweets by all members of a list. --->
<!--- GET lists/list --->
<cffunction name="getAllLists" access="public" output="false" hint="Returns all lists the authenticating or specified user subscribes to, including their own. The user is specified using the user_id or screen_name parameters. If no user is given, the authenticating user is used.">
<cfargument name="user_id" required="false" type="string" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" type="string" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/list.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/statuses --->
<cffunction name="getListStatuses" access="public" output="false" hint="Returns tweet timeline for members of the specified list. Historically, retweets were not available in list timeline responses but you can now use the include_rts=true parameter to additionally receive retweet objects.">
<cfargument name="list_id" required="true" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="string" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="since_id" required="false" default="" type="string" hint="Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available." />
<cfargument name="max_id" required="false" default="" type="string" hint="Returns results with an ID less than (that is, older than) or equal to the specified ID." />
<cfargument name="count" required="false" default="" type="string" hint="Specifies the number of results to retrieve per page." />
<cfargument name="include_entities" required="false" default="" type="string" hint="When set to either true, t or 1, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future" />
<cfargument name="include_rts" required="false" default="" type="string" hint="When set to either true, t or 1, the list timeline will contain native retweets (if they exist) in addition to the standard stream of tweets. The output format of retweeted tweets is identical to the representation you see in home_timeline." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/statuses.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/members/destroy --->
<cffunction name="deleteListMember" access="public" output="false" hint="Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.">
<cfargument name="list_id" required="false" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="user_id" required="false" default="" type="String" hint="The ID of the user to remove from the list. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" default="" type="String" hint="The screen name of the user for whom to remove from the list. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/members/destroy.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='DELETE',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/memberships --->
<cffunction name="getListMemberships" access="public" output="false" hint="List the lists the specified user has been added to.">
<cfargument name="user_id" required="false" default="" type="String" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" default="" type="String" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Optional. Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list." />
<cfargument name="filter_to_owned_lists" required="false" default="false" type="boolean" hint="When set to true, t or 1, will return just lists the authenticating user owns, and the user represented by user_id or screen_name is a member of." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & getAuthDetails().getUserAccountName() & '/lists/memberships.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/subscribers --->
<cffunction name="getListSubscribers" access="public" output="false" hint="Returns the subscribers of the specified list.">
<cfargument name="list_id" required="true" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/subscribers.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/subscribers/create --->
<cffunction name="addListSubscriber" access="public" output="false" hint="Subscribes the authenticated user to the specified list.">
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="list_id" required="false" default="" type="string" hint="The id or slug of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/subscribers/create.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/subscribers/show --->
<cffunction name="showListSubscriber" access="public" output="false" hint="Check if the specified user is a subscriber of the specified list. Returns the user if they are subscriber.">
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="list_id" required="true" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="user_id" required="false" default="" type="String" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" default="" type="String" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/subscribers/show.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/subscribers/destroy --->
<cffunction name="deleteListSubscriber" access="public" output="false" hint="Unsubscribes the authenticated user form the specified list.">
<cfargument name="list_id" required="false" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'list/subscribers/destroy.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='DELETE',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/members/create_all --->
<cffunction name="addMultipleMembersToList" access="public" output="false" hint="Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Note that lists can't have more than 500 members, and you are limited to adding up to 100 members to a list at a time with this method.">
<cfargument name="list_id" required="false" default="" type="string" hint="The id or slug of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="user_id" required="false" default="" type="String" hint="A comma separated list of user IDs, up to 100 are allowed in a single request." />
<cfargument name="screen_name" required="false" default="" type="String" hint="A comma separated list of screen names, up to 100 are allowed in a single request." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/subscribers/create_all.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/members/show --->
<cffunction name="checkListMember" access="public" output="false" hint="Check if the specified user is a member of the specified list.">
<cfargument name="list_id" required="false" default="" type="string" hint="The id or slug of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="user_id" required="false" default="" type="String" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" default="" type="String" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="skip_status" required="false" default="" type="string" hint="When set to either true, t or 1 statuses will not be included in the returned user objects." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/members/show.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- GET lists/members --->
<cffunction name="getListMembers" access="public" output="false" hint="Returns the members of the specified list.">
<cfargument name="list_id" required="true" type="string" hint="The id or slug of the list." />
<cfargument name="cursor" required="false" default="-1" type="string" hint="Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list." />
<cfargument name="include_entities" required="false" type="Boolean" hint="When set to true, each tweet will include a node called 'entities'. This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/members.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='GET',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/members/create --->
<cffunction name="addMemberToList" access="public" output="false" hint="Add a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.">
<cfargument name="list_id" required="true" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="true" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="user_id" required="false" default="" type="String" hint="The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name." />
<cfargument name="screen_name" required="false" default="" type="String" hint="The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID." />
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/members/create.json' />
<cfreturn genericAuthenticationMethod(httpURL=strTwitterMethod,httpMethod='POST',parameters=arguments,checkHeader=arguments.checkHeader) />
</cffunction>
<!--- POST lists/destroy --->
<cffunction name="deleteList" access="public" output="false" hint="Deletes the specified list. The authenticated user must own the list to be able to destroy it.">
<cfargument name="owner_screen_name" required="false" default="" type="string" hint="The screen name of the user who owns the list being requested by a slug." />
<cfargument name="owner_id" required="false" default="" type="string" hint="The user ID of the user who owns the list being requested by a slug." />
<cfargument name="list_id" required="false" default="" type="string" hint="The numerical id of the list." />
<cfargument name="slug" required="false" default="" type="String" hint="You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters." />
<cfargument name="checkHeader" required="false" default="false" type="boolean" hint="If set to true, I will abort the request and return the response headers for debugging." />
<cfset var strTwitterMethod = getCorrectEndpoint('api') & 'lists/destroy.json' />