Using password to access locked accounts?
domesticat - January 3, 2009 - 19:24
| Project: | Daily Twitter |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | jadestorm |
| Status: | active |
Jump to:
Description
I realized the code as it stands right now isn't something that I can test, so I thought I'd put in a feature request. Would it be reasonably easy to ask for twitter username AND password, in order to pull tweets from a private timeline?
It sounds a little odd, but here's why I suggest it. I keep my timeline private. Long story short: it's one of the few places I can draw a clear line between 'work' and 'home.' However, I do travel fairly regularly, and when I travel, collating and publishing tweets serves as a nifty travelogue.
This may not be a direction you're interested in going, and if so, I understand.

#1
I see no reason why I couldn't add that. =) -- well in theory. Have to make sure the API allows that but I can't see why it wouldn't.
#2
It should, since I've been running a script that does just that for every trip I've taken in the past 13 months. I cribbed it off the 'net about a year ago, so it's technically not my work (though I have modified it greatly) so if you're stumped, PM me and I'll forward the relevant bits on to you...
If you're curious, you can see one day's output of the script here: http://domesticat.net/2008/10/hawaii-twitterlog-saturday-october-25-2008
#3
Hi domesticat -- I don't know if you are still around, it's been a while obviously...
I can't find any reference to being able to provide a password via the APIs ---
http://apiwiki.twitter.com/Twitter-API-Documentation
Do you see something I don't? =/
#4
I'm still here. I'll even be at drupalcon Paris. :)
It looks like the script I have is an ugly scrape-and-parse. I see how it's getting the info, though:
<?php
$username = $_REQUEST['u'];
$password = $_REQUEST['p'];
$url = 'http://twitter.com/statuses/user_timeline.xml';
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
header ("Content-type: text/xml"); // Output file as XML
echo($buffer);
?>
That help?
#5
Interesting -- that looks pretty straightforward. Didn't occur to me (though I kind of declare duh on myself) to "just so http authentication". =D Thanks!
#6
Hey would you consider curl to be a common include for php? Like would it be unreasonable for me to make use of curl instead of what I'm currently doing? I don't have a good gauge for how widespread it's built into php. (I've never seen it -not- available, but I think that I tend to work with a limited set of setups)
#7
Hey would you consider curl to be a common include for php? Like would it be unreasonable for me to make use of curl instead of what I'm currently doing? I don't have a good gauge for how widespread it's built into php. (I've never seen it -not- available, but I think that I tend to work with a limited set of setups)
#8
I've had it not be available to me once. If curl works for you, use it, but I'd definitely mention that it's a requirement. It might save support questions later.
#9
I could probably pretty easily just disable the password functionality if you don't have curl. that's really the only part of it I feel I -need- curl for.