Welcome Guest, Not a member yet? Register   Sign In
Twitter Libraries
#1

[eluser]darkhouse[/eluser]
Let me be clear up front. I don't like twitter. I think it's a waste of time, and I can't get over the fact that it's so popular. Maybe I'm just too lazy to care about it. But nonetheless, my clients use it. I'll apologize in advance for my little rant.

I've seen a few twitter libraries here, and generally they all work the same way. The one that I had trouble with was this one by Elliot Haughin. I wasn't able to get the oAuth stuff working, simply because changing the uri_protocol to PATH_INFO broke everything. I have some ajax stuff working, and well it stopped working when I changed it to PATH_INFO. To be honest, I'm not even really sure what the oAuth stuff is for, why do I need to create an application on twitter, and why do I need to authorize my site to use the application?...

My problem is, I'm trying to get the contents of this page on a site. Now, if I use the user_timeline method, I only get posts made by this user. I don't get any retweets. If I just use the RSS feed that's available, I get everything, except the longer tweets are truncated. They're actually truncated if you're viewing that page and not logged in to twitter. However, if you ARE logged in, you'll see the full tweet, but still the longer tweets in the RSS feed are truncated.

Is this just a major flaw with twitter? Is it possible to get the full tweets using the oAuth solution? It's just silly why I have to jump through hoops to get some content to work properly. It's not like I'm building some crazy app to integrate with twitter... I just want the feed that's on their twitter page. Should be simple.

Any ideas? Thanks.
#2

[eluser]ironlung[/eluser]
Yeah PATH_INFO didn't work at all on my server either so its unusable for me, shame as its the only OAuth twiiter version I can find.... So I'll carry on digging and hope I find a fix...
#3

[eluser]darkhouse[/eluser]
I'd forgotten I'd posted this - since then I needed to create another Twitter app, and this worked well. I don't recall everything I did, there were a number of changes I had to make in the config file, as well as extend some libraries, but I was able to get everything working properly.

The app was a promotion system that integrated with Twitter, Facebook and MailChimp, and it depending on which one the user decided to use, it made sure they were a follower, fan or subscriber before displaying the promotion.

I'm still not a fan of Twitter, but I now see how useful it is for businesses - I still think it's a waste of time for personal use between friends, but that's just me.
#4

[eluser]ironlung[/eluser]
[quote author="darkhouse" date="1270869585"]I'd forgotten I'd posted this - since then I needed to create another Twitter app, and this worked well. I don't recall everything I did, there were a number of changes I had to make in the config file, as well as extend some libraries, but I was able to get everything working properly.

The app was a promotion system that integrated with Twitter, Facebook and MailChimp, and it depending on which one the user decided to use, it made sure they were a follower, fan or subscriber before displaying the promotion.

I'm still not a fan of Twitter, but I now see how useful it is for businesses - I still think it's a waste of time for personal use between friends, but that's just me.[/quote]


Hey I'm glad you got everything workking ok in the end, did you use the Eliot Haughlin library?
#5

[eluser]darkhouse[/eluser]
Oh, sorry, I should've made that clear. I DID use Elliot's library. Unfortunately I don't have the code here so I can't remember what I did exactly to get it to work, but it IS working. If you have some specific issues I'll try and help.
#6

[eluser]ironlung[/eluser]
I guess my first issue is the server from my service provider simply doesn't like PATH_INFO, it won't even allow me to make any controller call other than the default controller. Maybe I can work through when I get past that, did you make it work without using PATH_INFO?
#7

[eluser]darkhouse[/eluser]
Ok, I realized that I was able to access the code from the SVN (duh...) and grabbed the project. I got it working by setting the uri_protocol to QUERY_STRING and setting enable_query_strings to TRUE.

Then in MY_Input I overwrote the _clean_input_keys function to just return the string, like this:
Code:
function _clean_input_keys($str)
{
    /*if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
    {
        exit('Disallowed Key Characters.');
    }*/
    
    return $str;
}

I had trouble getting ? as an acceptable uri character, so I just got rid of the function.

I don't see anything else at first glance... let me know how that works out.
#8

[eluser]ironlung[/eluser]
Hey kewl thanks for the info I'll have a try tomorrow...
#9

[eluser]ironlung[/eluser]
I gave in and just used the Simon Maddox libraries which doesn't use oauth but is ok for me at the moment and appears to work for now Smile




Theme © iAndrew 2016 - Forum software by © MyBB