[twitter-dev] Re: DDoS update: Friday 8PM PDT
Awesome! Thanks for the update! Glad your on the Twitter team. On Aug 7, 11:20 pm, Chad Etzel wrote: > Hello all, > > Here is the state of things as we know them: > > - The DDoS attack is still ongoing, and the intensity has not > decreased at all. Because of this, interaction with the site and with > the API will continue to be shaky due to the defenses that have been > put in place by our Ops team. At this point, removing any of those > defenses is not an option. > > - Whitelisted IPs that have a restricted rate-limit is a *known > issue,* and we are still working on restoring increased rate-limiting. > > - OAuth funkiness is a *known issue* which seems to be exacerbated by > the whole DDoS thing. > > - Automatic blacklisting of "valid" or "innocent" IPs is a *known > issue* and a result of the DDoS defenses. These blacklistings are > temporary, though the amount of time they "stick" is variant upon the > number of requests being made. The best thing to do to avoid this is > throttle back your requests. We know that this may not be an option > for everyone, but if you can, it will help. > > - Keep respecting 302's as you get them. > > THIS IS THE MOST IMPORTANT POINT. PLEASE READ IT TWICE: > *There is no ETA on fixing any of this* > *There is no ETA on fixing any of this* > > I know that sounds harsh and cold, but if you want us to be perfectly > honest with you, that's the truth. Things will continue to be rocky as > long as this attack continues. They may get worse, they may get > better. That should not be read as "we don't care about fixing it" or > "we're not going to fix it until everything blows over" but instead as > "we can't promise when things will be back to normal, but in the > meantime we are working on fixing is ASAP." > > Ops is going to be working around the clock this weekend. > > We will also be monitoring the situation and giving out new > information as we have it. Please remain patient with us. As much as > you want it to be fixed, we want it to be fixed more. Some of my > personal apps are completely borked as well. We're all going to have > to ride this out together. Communications may be slowed over the > weekend, but please know that we are not ignoring the situation. > > Thanks, > -Chad
[twitter-dev] Re: Revoke/Destroy Access Method?
alright thanks! On Jun 8, 8:25 pm, Abraham Williams <4bra...@gmail.com> wrote: > I would just say delete the access tokens from your database and call it > good. If they care that much they can figure the connections page on their > own. > > > > > > On Mon, Jun 8, 2009 at 18:21, fastest963 wrote: > > > Sorry about the late reply... > > > I mean if the user revokes access from my site, not knowing that he/ > > she should go through yours? > > Or should I just direct users to the "connections" page to revoke > > access directly from your site? > > > On Jun 5, 8:22 am, Abraham Williams <4bra...@gmail.com> wrote: > > > Why would you need to destroy the access keys? They stop working once the > > > user revokes access. I guess you could delete them from your database. > > > > On Fri, Jun 5, 2009 at 06:44, fastest963 wrote: > > > > > So user deletes his/her twitter access from my site, as in she says I > > > > don't want to give this app access anymore so on my site she clicks > > > > "remove twitter access/account". > > > > Is there a method I can call to destroy the access keys I received and > > > > automatically revoke access to my application? I know for Facebook, it > > > > is a rule, you MUST destroy the keys and disconnect the user if they > > > > cancel access, but I don't see this anywhere on Twitters > > > > documentation. > > > > > Thanks, > > > > @fastest963 > > > > -- > > > Abraham Williams |http://the.hackerconundrum.com > > > Hacker |http://abrah.am|http://twitter.com/abraham > > > Project |http://fireeagle.labs.poseurtech.com > > > This email is: [ ] blogable [x] ask first [ ] private. > > -- > Abraham Williams | Community |http://web608.org > Hacker |http://abrah.am|http://twitter.com/abraham > Project |http://fireeagle.labs.poseurtech.com > This email is: [ ] blogable [x] ask first [ ] private.
[twitter-dev] Re: Revoke/Destroy Access Method?
Sorry about the late reply... I mean if the user revokes access from my site, not knowing that he/ she should go through yours? Or should I just direct users to the "connections" page to revoke access directly from your site? On Jun 5, 8:22 am, Abraham Williams <4bra...@gmail.com> wrote: > Why would you need to destroy the access keys? They stop working once the > user revokes access. I guess you could delete them from your database. > > On Fri, Jun 5, 2009 at 06:44, fastest963 wrote: > > > So user deletes his/her twitter access from my site, as in she says I > > don't want to give this app access anymore so on my site she clicks > > "remove twitter access/account". > > Is there a method I can call to destroy the access keys I received and > > automatically revoke access to my application? I know for Facebook, it > > is a rule, you MUST destroy the keys and disconnect the user if they > > cancel access, but I don't see this anywhere on Twitters > > documentation. > > > Thanks, > > @fastest963 > > -- > Abraham Williams |http://the.hackerconundrum.com > Hacker |http://abrah.am|http://twitter.com/abraham > Project |http://fireeagle.labs.poseurtech.com > This email is: [ ] blogable [x] ask first [ ] private.
[twitter-dev] Revoke/Destroy Access Method?
So user deletes his/her twitter access from my site, as in she says I don't want to give this app access anymore so on my site she clicks "remove twitter access/account". Is there a method I can call to destroy the access keys I received and automatically revoke access to my application? I know for Facebook, it is a rule, you MUST destroy the keys and disconnect the user if they cancel access, but I don't see this anywhere on Twitters documentation. Thanks, @fastest963
[twitter-dev] Re: request_token gives "Failed to validate oauth signature and token"
Ok never mind that last post. Just 2 mins ago, my keys started working. So just hold on, it looks like they are fixing it. On May 31, 10:17 pm, fastest963 wrote: > I'm getting the same thing. Looks like Twitter is having some problems > updating its OAuth applications with any new registrations or consumer > keys. > > On May 31, 4:00 pm, kollynews wrote: > > > > > I am trying to run a sample application (http://github.com/abraham/ > > twitteroauth) but i am getting 401 error during request_token phase. > > It says "Failed to validate oauth signature and token". Can anybody > > help me in this. > > > this is what i am accessing: > > >https://twitter.com/oauth/request_token?oauth_version=1.0&oauth_nonce... > > > anything wrong in the headers ?
[twitter-dev] Re: request_token gives "Failed to validate oauth signature and token"
I'm getting the same thing. Looks like Twitter is having some problems updating its OAuth applications with any new registrations or consumer keys. On May 31, 4:00 pm, kollynews wrote: > I am trying to run a sample application (http://github.com/abraham/ > twitteroauth) but i am getting 401 error during request_token phase. > It says "Failed to validate oauth signature and token". Can anybody > help me in this. > > this is what i am accessing: > > https://twitter.com/oauth/request_token?oauth_version=1.0&oauth_nonce... > > anything wrong in the headers ?
[twitter-dev] Re: Freelance Twitter API Dev directory?
You know me: Name: James Hartig (@fastest963) Company: isociale.com email: fastest...@gmail.com PHP, MySQL, AJAX, HTML, JS On Feb 23, 1:33 pm, Alex Payne wrote: > There isn't one that I'm aware of, but if people would like to post > their contact info in this thread (Twitter username, URL, email, > whatever) I'm happy to collect them on the API Wiki. > > On Sat, Feb 21, 2009 at 18:00, Chad Etzel wrote: > > > Hi All, > > > I have been getting a few requests here and there for twitter API > > development work. I cannot take on any such projects at the moment, > > but I always feel bad for leaving them in the lurch. Is there a list > > or directory anywhere of Twitter API developers that work freelance > > that I can send to them when this happens? I'm happy to forward on > > such requests. > > > -Chad > > -- > Alex Payne - API Lead, Twitter, Inc.http://twitter.com/al3x
[twitter-dev] Re: Freelance Twitter API Dev directory?
You know me: Name: James Hartig Company: isociale.com email: fastest...@gmail.com PHP, MySQL, AJAX, HTML, JS On Feb 23, 7:56 pm, "Westley Annis" wrote: > Username: WestleyAnnis > url:http://www.da-parish.com > email: west...@da-parish.com > Technology: PHP > > > > -Original Message- > > On Feb 23, 2:33 pm, Alex Payne wrote: > > There isn't one that I'm aware of, but if people would like to post > > their contact info in this thread (Twitter username, URL, email, > > whatever) I'm happy to collect them on the API Wiki. > > > On Sat, Feb 21, 2009 at 18:00, Chad Etzel wrote: > > > > Hi All, > > > > I have been getting a few requests here and there for twitter API > > > development work. I cannot take on any such projects at the moment, > > > but I always feel bad for leaving them in the lurch. Is there a list > > > or directory anywhere of Twitter API developers that work freelance > > > that I can send to them when this happens? I'm happy to forward on > > > such requests. > > > > -Chad > > > -- > > Alex Payne - API Lead, Twitter, Inc.http://twitter.com/al3x
Re: PHP / Curl API failures
try increasing your connecttimeout On Feb 3, 8:48 am, Cameron Kaiser wrote: > > On Sunday (1 Feb 2009) I embedded the following code in my website > > (with appropraite variables set correctly): > > [...] > > > Which worked fine up until Monday morning (02 Feb 2009, 10:00 GMT > > ish). It then failed for about 24 hours. I started debugging it last > > night and my PHP script was not getting any status code back on the > > curl_exe line. Today (3 Feb) at about 08:00 it started working again > > without me changing anything! > > > I post about 10 message an hour (no more!) so I shouldn't reach any > > limits I guess. Can anyone suggest what is going on here ? > > 1) Connectivity? > > 2) Consider > > curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); > > in your PHP code or adjusting your timeout. > > -- > personal:http://www.cameronkaiser.com/-- > Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com > -- BOND THEME NOW PLAYING: The James Bond Theme from "Dr. No" > -
Re: Call for OAuth beta participants
@Alex I would recomend emailing him at a...@twitter.com. However your idea sounds pretty awesome though. I'm working on site that is a social profile, and connects all of the social sites in one easy place. It's pretty intriguing! I can't wait to start using OAuth.
Re: Dumping, Storing, and Displaying XML data with PHP and MySQL
Do: -- //connect to database (code) $query = sprintf("INSERT INTO TABLE+NAME (`time`, `body`, `favorited`, `name`, `description`, `avatar`, `url`, `twitterid`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", mysql_real_escape_string($xml->status->created_at), mysql_real_escape_string($xml->status->text), mysql_real_escape_string($xml->status->favorited), mysql_real_escape_string($xml->status->user->name), mysql_real_escape_string($xml->status->user- >description), mysql_real_escape_string($xml->status->user- >profile_image_url), mysql_real_escape_string($xml->status->user->url), mysql_real_escape_string($xml->status->id)); mysql_query($query) or die(mysql_error()); echo "Data Inserted!"; mysql_close (); --
Re: Source of Direct Messages
Apps should get an API-key or something and then if they wanted their source name included then they would have to use their API-key and it would do a lookup key -> name from there? That would only apply for apps that want their name as the source. Also, if that could be implemented, an optional, source for DMs would be nice.
Re: Maximum allowed tweets per minute
When you hit the rate limit, you should get some sort of HTTP error, and not a valid return (at least thats what I was lead to believe). As far as a "tweet" limit, there isn't a limit, but your followers might get angry and annoyed and unfollow you. I don't know what your purpose is though. If your tweets are too similar, they might not be posted again, as we have brought up before in discussion. By "tweets are simply not being allowed for a user" what do you mean? HTTP Error? Sending a Tweet via API and it not being correctly displayed via the website and/or API?
Re: Listings for completed Twitter Apps
When using the twitter section, append the URL after the user has entered his/her status. This way you won't need "Edit your status but please do not change the address in it ", and it will be more user- friendly. Just append the URL via JS before submitting to Twitter and add a little note: "The link will be appended to the end of the status".
Re: Racking my brain to figure out how to use users/show
Just use fwrite($local, file_get_contents()); Also, use the JSON format and the json_decode, and it will make a nice array for you. Then you can use a regex to get the src from the profile_image_url. If you wanted I could write some simple code up if you can't understand what I mean? As far as a faster/better way to "download" the image, you could try maybe CURL and then do a fwrite with that, or you could use sockets, but file_get_contents() is the easiest.
Re: Automated postings to Twitter
Yes, that's fine. I would say the best way would be http://apiwiki.twitter.com/Search+API+Documentation and http://apiwiki.twitter.com/REST+API+Documentation#update On Dec 18, 5:52 am, JohnSouth wrote: > Hi > > I've seen some examples of postings that seem to be automated inputs > from an organisation, for example TelegraphMG. > We run a website that collects details of events round the UK and I > can see that each one could be a posting to Twitter. Is this an > acceptable use of Twitter? (There would be up to 200 on a busy day.) > If so what's the best way to automated the process? > > Regards and best wishes > > John South > Customer Supportwww.WhereCanWeGo.com
Re: Request: More Helpful 'X is now following you' Emails
Good idea! The block link could just be a link to http://twitter.com/blocks/confirm/{user id?} then twitter would, as I assume require that you login. Good information to show would be user followers to following ratio (as for bots).
Re: Displaying @replies or direct messages on a webpage in PHP or HTML
Working example: http://twittertrend.net/searchtw.php?q=fastest963 q={query} On Dec 17, 8:40 pm, fastest963 wrote: > >In the meantime, is there an example of JSON search API code? > > http://pastie.textmate.org/private/yzqfdabfwltlwzbuzwdmkg > > I have tested with a few queries. Any changes anyone else?
Re: Displaying @replies or direct messages on a webpage in PHP or HTML
>In the meantime, is there an example of JSON search API code? http://pastie.textmate.org/private/yzqfdabfwltlwzbuzwdmkg I have tested with a few queries. Any changes anyone else?
Re: Displaying @replies or direct messages on a webpage in PHP or HTML
>In the meantime, is there an example of JSON search API code? http://apiwiki.twitter.com/Search+API+Documentation http://www.twitter2html.com/ Regarding the Search API, I will write a simple script and reply with the url.
Re: Using php api to send @replies to specific messages
>For direct messages I don't think it is possible to use in_reply_to_status_id >since it is a completely different id system. That would not be possible as Twitter has no relation between the two systems. You can append the id number of the tweet in your DM though like d username #1063925739 or like regarding:1063925739 or something of that extent. -James Hartig
Re: API Changes for Dec 17, 2008
For 183: Umm, i would prefer on public_timeline, firehose, Data mining and status/show? I collect the timezones (as you know for TwitterTrend) and as of now I have to collect the UserID then get the user/show timeline only for the "time zone" field, which hurts my end and gives you more load. For 180: The field just doesn't show up in data mining and public_timeline? It works fine in status/show and user_timeline. Is this on purpose? Thanks so much! -James Hartig :) http://twittertrend.net
Re: API Changes for Dec 17, 2008
Sorry, I forgot you gave that to stevef, I meant 183 :) My bad...
Re: API Changes for Dec 17, 2008
:) Sweet! When can I expect http://code.google.com/p/twitter-api/issues/detail?id=180 to be fixed? Its really killing my site right now :(
Re: problem returning a public status
http://twitter.com/help/request_whitelisting
Re: What is returned when a protected ID is fetched with show?
Ah gotcha! so i should just just look for the 200 status code :) Thanks! On Dec 12, 11:00 pm, "Damon Clinkscales" wrote: > cURL is your friend. > > "Bad ID": > $ curl "http://twitter.com/statuses/show/123456.json"; > {"request":"\/statuses\/show\/123456.json","error":"No status found > with that ID."} > > "Protected Update": > $ curl "http://twitter.com/statuses/show/1054113093.json"; > {"request":"\/statuses\/show\/1054113093.json","error":"Sorry, you are > not authorized to see this status."} > > "Public Update": > $ curl "http://twitter.com/statuses/show/1052591473.json"; > {"in_reply_to_user_id":null,"text":"\"Why do you look askance at my > juice.\"","user":{"description":"No ideas but in > things.","url":"http:\/\/1vy.org\/","name":"Evan","followers_count":1124,"p > rotected":false,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_pro > duction\/profile_images\/66286904\/aquarium-fish-icon_normal.jpg","screen_n > ame":"_evan","location":"Russian > Hill, > California","id":761613},"in_reply_to_screen_name":null,"truncated":false," > favorited":false,"created_at":"Fri > Dec 12 02:31:44 + > 2008","id":1052591473,"in_reply_to_status_id":null,"source":"web"} > > -damon > > On Fri, Dec 12, 2008 at 9:24 PM, fastest963 wrote: > > > Well, the subject says it all, but I'm requesting a ID by /statuses/ > > show/123456.json and I was wondering what I can expect the output to > > be if either the ID doesn't exist or if it is protected. > > > In other words: how can I easily check to see if it returned > > correctly? > > > Thanks, > > James Hartig
What is returned when a protected ID is fetched with show?
Well, the subject says it all, but I'm requesting a ID by /statuses/ show/123456.json and I was wondering what I can expect the output to be if either the ID doesn't exist or if it is protected. In other words: how can I easily check to see if it returned correctly? Thanks, James Hartig
Re: weird case: user returns blank json for users/show but works for xml
Did you just create your account? It seems that Twitter has been having some user problems and all the data is cached from 24 hours ago. It might be that the xml file updated but not the json yet? Also, I have tried a few other usernames and they all seem to return fine.
Re: Incomplete list of friends being returned
I second Greg's problem, I was having this problem too, but after looking through all my users, 4 were suspended and thus didn't show up in the API.
Re: Search API Rate Limiting
Ah, gotcha! You can, it will just display a browser warning. Which is not what you want :P The Terms say: "We do not rate limit the search API under ordinary circumstances, however we have put measures in place to limit the abuse of our API." Try emailing, Alex Payne, or someone at Twitter about a whitelist. On Dec 7, 3:36 pm, "Chad Etzel" <[EMAIL PROTECTED]> wrote: > No, you can't do an ajax authenticated GET or POST to a 3rd-party site. I > am dynamically loading the json in the clients' browser. I would rather > know the rate limits so I can abide by them. > > -Chad > > On Sun, Dec 7, 2008 at 10:42 AM, fastest963 <[EMAIL PROTECTED]> wrote: > > > Since your doing this via AJAX and such, this may not be a good idea, > > but you could try passing a login to Twitter and having that login > > whitelisted?
TwitterTrend User Indexing Started!
Since we cannot index old data via the public timeline or the data mining feed, we opened up a way for users to submit their timeline for indexing! This is plagued by the Username/Password situation, but as soon as OAuth is released or anything else, I will fully support it! :) Also, I have had two Twitter API requests, http://code.google.com/p/twitter-api/issues/detail?id=180 and http://code.google.com/p/twitter-api/issues/detail?id=183 The first one is regarding the missing "link" to the source, in the Data mining and public timeline APIs. The links seem to work fine in the user timeline. The second one is a request for 3 new fields to be added to the Firehose/timelines, I would like them because, currently I have to request Twitter again for user information like timezone, etc. that should be included in timeline's user field. I don't understand why followers_count was included but not updates_count or following_count? If you agree/like either of the requests, please star them so they get noticed :) Thanks, James Hartig
Re: Search API Rate Limiting
Since your doing this via AJAX and such, this may not be a good idea, but you could try passing a login to Twitter and having that login whitelisted?
Re: API request: twitterverse
Search for a site like mine, that caches users and then you can get a more accurate estimate, however it will only be of active users (at least for mine). - James Hartig
Re: Map of users/show time_zone value to PHP's Timezone constants
You mean you want to convert Twitter's Timezone list to match PHP's timezones? This would have to be done by a pre-generated list or array that would have to be matched to and converted. It shouldn't be too hard? - James Hartig
Re: Cannot POST Updates; API returns a 400.
In twitter_process() comment out curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_HEADER, 0); Also, change curl_setopt ($ch, CURLOPT_POST, true); to curl_setopt ($ch, CURLOPT_POST, 1); There is a problem because you are sending (if !empty($post_data)) the HTTP Method HEAD and POST, if you comment out the lines above, it should work, then if it does, then good. The NOBODY and HEADER shouldn't be used at all anyway in your setup because they will disable the header and the body, it seems like in the rest of your code you need those as you perform different tasks with the body and the header (if is 200). Hope that helps! - James Hartig
Re: Rate limit exceeded for whitelisted app
It looks like IPs still work? Twittertrend is still running perfectly fine? I think whitelisted users/IPs are hitting the rate_limit but the API isn't acknowledging it? My "remaining_hits" is -36 but my API requests are still processing fine.
Re: Rate limit exceeded for whitelisted app
It seems they are still restoring the database...
Difference between mobile and sms source?
What is the difference between the mobile and sms source?
Re: Is SSL (TLS/https) officially supported?
It's supported but depending on the platform, you may need to update your Security Certificates (if using PHP+CURL).
Re: Twitter, Push APIs and XMPP
HTTP-Push? As in get? post? or something I'm new at? :P
Re: Twitter, Push APIs and XMPP
As far as I know, the Firehose API would only be for retrieving data from Twitter and not sending (POST). @bham 10-15s isn't that bad? If it was over a minute then I would be concerned. As far as the latency, I can assume that it is just because of the caching that Twitter has put into place.
Re: API Limits for me to extract Direct messages
You can request your account or IP to be whitelisted via: http://twitter.com/help/request_whitelisting Also, depending on the account, you shouldn't be required to make many requests a minute to check their direct messages. (Unless of course your user is an insane DMer) Hope that helps!
TwitterTrend Up! Happy Thanksgiving!
First, I would like to wish everyone a Happy Thanksgiving! My site, http://twittertrend.net is up! It is a site that indexes twitter and creates stats and trends about URLs posted on twitter. Last time I checked we had indexed 1.75 million URLs! I will be working on a way to index all of twitter's old data. It will come as soon as the twitter devs finish their work on OAuth. I have spent a great deal of time optimizing code and getting everything to work under restrictions from BlueHost. I will be finishing up graphs and other "unfinished" parts of the site. For the most part we are all up and running! Feel free to comment about it below! Also, I would like to thank Twitter for their help with the service and for giving me the opportunity to use their wonderful API and their data mining feed. I would like to extend this thanks directly to Alex Payne, as he has made this project possible and I am in great debt to him! Follow @twitrend for any news! Happy Thanksgiving! -James Hartig http://jhartig.com
Re: a simple workaround for lack of OAuth
@Amir That is not a very relevant question. Why do you want to make multiple accounts? @al3x A better alternative would be to just create an API key for every user. Instead of entering username/password, they would enter their secret API key?
Re: update_profile_colors changes will not work when a theme is selected
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/29b4e3f4a50b81ac?hl=en Maybe that can help?
Re: update_profile_colors changes will not work when a theme is selected
Are you saying you are not seeing a change on screen? Could it be a cache problem?
Re: Helpful PHP Optimizations
I finally ended up switching to MySQLi because it offered "ping" and reconnect options. For some reason I kept getting "MySQL Server has gone away" with PDO, even with persistent. I tried many different ways to detect that and then reconnect, but PDO just doesn't support it. I will be making the switch later on today and I'm hoping to have it converted in less than an hour :)
Re: Helpful PHP Optimizations
> This actually is a slow down, You should store each tweet as a row in > the table > and not 10 tweets as 1 serialized row. You not only can't search well, > but updates, > and retrieval will be hindered. Yes, that is definitely true, however for certain circumstances (as with data that you will never need to search through) it can be very useful in saving space and rows. For most of the extra data (timezone, etc) we store in arrays because I do not ever envision looking up timezones. The only problem with arrays is sorting easily. You can do sort() or asort() or similar commands, but at first they are difficult to master. > PDO will use the mysql-nd driver if you have it installed, which > allows for persistent connections. That might offa speed boost as well. Yes, this might be true (I have seen stats both ways), however with majority of our scripts, they terminate before or at 60 secs (because of refresh rate of data mine API), so having persistent connections is not worth it yet. I will review more comparisons and reply with my results. > I'm not sure PHP strtolower issafe for multi-byte UTF-8. My PHP is > very rusty but I think the (slower) mb_strtolower is multi-byte character > safe. I don't think this affects the code you're using, but it's always > worth mentioning. Very good point Matt, yes mb_strtolower() (that is the correct function) would be better, however I would like to point out that it can be almost 50% slower in most cases. This would not work for our setup as we need to process tweets in less than .1 secs. Also, I understand that Twitter would like to be as diverse as possible, however I have not setup any of my Regular Expressions for non-UTF-8 chars so be running this I'm actually helping out the rest of the script. Thanks for all the input, keep it coming!
Re: Fixes deployed Nov 14th
Agreed! Could we get a friends count? That is also showed on the Twitter website.
Re: Scanning email for custom Twitter headers
They seem to be sending fine to me. Is imap_fetchheader() returning anything? Paste what it is sending back to you. Also, you can try the following... -- // get imap_fetch header and put single lines into array $header = explode("\n", imap_fetchheader($imap, $msg)); // browse array for additional headers if (is_array($header) && count($header)) { $head = array(); foreach($header as $line) { // is line with additional header? if (eregi("^X-", $line)) { // separate name and value eregi("^([^:]*): (.*)", $line, $arg); $head[$arg[1]] = $arg[2]; } } }else{ echo $head; } -- The $head variable can be used to get each twitter variable like so... $head['TwitterDirectMessageID'] or whatever the header without 'X-'. Hope that helps! -James
Re: Helpful PHP Optimizations
For majority of queries, mysqli is only a fraction faster, and converting our whole script to mysqli would take a lot of work. I decided that at this time it was not worth it, as PDO is also very versatile and lightweight. For other users starting their script, I would recommend using mysqli if you are very familiar with mysql and would need any speed increases possible, everyone else should use PDO. Another note: md5 is case-sensitive! If using indexes as I have stated above and using tables with md5 first letter, then remember to do strtolower() for indexes and before doing md5! I will keep this updated with any new things I come along.
Re: Helpful PHP Optimizations
I will try the mysqli extension, I totally forgot about that! I needed a driver with a reconnect command anyways. Also, sorry about forgetting to mention prepares, I use them all the time, I just failed to mention them when I wrote the first post. I would use transactions, however most of the inserted rows are used in references later (insert_id). Also, a standard mysql insert right now only takes (average) .0025 secs to complete. So it is not a big worry on my list right now :) Thanks for the help. I'll keep this posted on mysqli success.
Helpful PHP Optimizations
PHP Optimizations PDO (http://www.php.net/pdo) is a must! Speeds up database transactions 1) Store as much data as possible into database 2) Store data as arrays for each updating and fetching (see serialize) 3) Always use an index field in mysql 4) Limit echos/prints Most Important: If connecting to pages (ex. API calls) use CURL Multi Connects (http://tinyurl.com/366yey) (use 2nd example) Also try to make use of Forking (http://tinyurl.com/2d6pwp) MYSQL Optimizations 1) Use BIGINT 255 unsigned fields for ids or anything that could get really large 2) Remember OPTIMIZE Finally, if you are storing a lot of data. Do the following: Take the ID (index), hopefully not a number, and md5 it. Then store into a specific table based on the first letter of the md5. Example: $user = "fastest963"; //store user $let = md5($user); //md5 username "SELECT * FROM".$let[0]."users WHERE `username` = '$user' "; //$let[0] is the first letter of the md5 Tables would be created like this: First make "0users" table. Then copy and make 1-F tables. 0users, 1users, 2users, 3users, 4users, 5users, 6users, 7users, 8users, 9users, ausers, busers, cusers, dusers, eusers, fusers Those would be all the table names, thus splitting your data per table by 16. I hope that helps people out when optimizing their scripts. These have allowed me to process 2000+ tweets per sec via PHP. Any questions? Feel free to comment! Thanks, James Hartig
Helpful PHP Optimizations
PHP Optimizations PDO (http://www.php.net/pdo) is a must! Speeds up database transactions 1) Store as much data as possible into database 2) Store data as arrays for each updating and fetching (see serialize) 3) Always use an index field in mysql 4) Limit echos/prints Most Important: If connecting to pages (ex. API calls) use CURL Multi Connects (http://www.ibuildings.com/blog/archives/811-Multithreading-in-PHP- with-CURL.html) (use 2nd example) Also try to make use of Forking (http://immike.net/blog/2007/04/08/ fork-php-and-speed-up-your-scripts/) MYSQL Optimizations 1) Use BIGINT 255 unsigned fields for ids or anything that could get really large 2) Remember OPTIMIZE Finally, if you are storing a lot of data. Do the following: Take the ID (index), hopefully not a number, and md5 it. Then store into a specific table based on the first letter of the md5. Example: $user = "fastest963"; //store user $let = md5($user); //md5 username "SELECT * FROM".$let[0]."users WHERE `username` = '$user' "; //$let[0] is the first letter of the md5 Tables would be created like this: First make "0users" table. Then copy and make 1-F tables. 0users, 1users, 2users, 3users, 4users, 5users, 6users, 7users, 8users, 9users, ausers, busers, cusers, dusers, eusers, fusers Those would be all the table names, thus splitting your data per table by 16. I hope that helps people out when optimizing their scripts. These have allowed me to process 2000+ tweets per sec via PHP. Any questions? Feel free to comment! Thanks, James Hartig
Re: invalid profile_image_url returned in JSON timeline
Did you maybe copy something wrong... the first link is 64498715 and the second is 64499571 (notice the last 3 digits).
Re: statuses/replies.xml and statuses/friends.xml return "Not found"
Can you provide that account name that you are using to login? It may be removed or suspended? If not then alex or someone will have to take a look because it would be a server problem. In the past however, I got this message when I tried to use an account that was suspended.
Re: Not pulling @replies in a search feed
No, what you would have to do is run a REGEX or similar search for @ [username] and if it returns false then process the data. There is no way to omit results from the API standpoint.
Re: statuses/replies.xml and statuses/friends.xml return "Not found"
Is that all that is sent? A 404 header and "Not Found" in the content? When did you access the APIs? I know that twitter was having some trouble yesterday with their site, is it still not working?
Re: Update status Using API.
For some reason it seems it didn't post my fix, here it is again: In the process() function, change: if($this->username !== false && $this->password !== false) curl_setopt($ch, CURLOPT_USERPWD, $this->username.':'.$this- >password); To: if($this->username !== false && $this->password !== false) curl_setopt($ch, CURLOPT_USERPWD, base64_encode($this->username.':'. $this->password)); That should work fine :)
Re: Update status Using API.
it seems it didn't post my fix here it is again: In the process() function, change: if($this->username !== false && $this->password !== false) curl_setopt($ch, CURLOPT_USERPWD, $this->username.':'.$this- >password); To: if($this->username !== false && $this->password !== false) curl_setopt($ch, CURLOPT_USERPWD, base64_encode($this->username.':'. $this->password)); That should work fine :)
Re: Update status Using API.
This library is not coded very accurately. I will post a fixed version within the next few days. My dev computer is currently under-repair, but when its finished (tonight?) I will work and fix this library. In the mean-time, just make the change noted in my previous post and the update() function should work fine.
Re: Update status Using API.
If your using: http://code.google.com/p/php-twitter/ which is what it looks like... then you need to specify $twit->username = ""; $twit->password = ""; $twit->User-Agent = ""; then call the $twit->update If that's not the correctly library, you still should have to set those somehow, either statically in the class.twitter.php file or through your script, like above.
Re: Retrieve Another User's Friends Timeline without Authentication?
You cannot, sorry. However, you can keep track of Twitter's progress on OAuth. This method would not require any passwords.
Re: Suspended Accounts still being returned in follower data
Instead of "removing" them, you should just add a field like 'status' or something similar.
Re: How to get Notifications about the updates in a third party applcaition.
You can try GNIP, however I haven't used them before. Yes you should probably loop every 3-5 (maybe more, depending on how accurate you want to be) minutes or so depending on the user. This shouldn't have too much of an impact on overall performance, however as you get more and more users, you will want to find an alternative system. If you want, down the road (month?), I can offer something more efficient and better if you would like?
Re: posting updates via js
I just noticed something shouldn't the Content-Type: application/x-www-form-urlencoded This could be the problem.
Re: posting updates via js
HTTP 500 Error usually means its a server error and its not your fault, however it may have something to do with your status post data. If you could, post the return headers and/or body. Also, it may have just been a simple problem with Twitter at the time. I just tested the API and it works fine for me: http://twitter.com/fastest963/status/1003271037 Maybe Alex or other devs can shed some light on something wrong with the Headers you sent.
Retrieving old tweets?
I have talked with Alex much on this topic but here's what I'm doing. I'm indexing tweets and then processing the URLs and then storing information and stats about the urls for webmasters etc. I was wondering if there was anyway I can index previous tweets (like last weeks or something). I doubt that there is, however it would really help our service get started quickly with more accurate results! Thanks!
Re: How to get Notifications about the updates in a third party applcaition.
You would have to use the http://apiwiki.twitter.com/REST+API+Documentation#usertimeline You can do either two things... With Database: Store the id of any ads you enter after entering (see later) Fetch the contents of http://twitter.com/statuses/user_timeline.xml?since_id={last id of ad} Then get the count of what is in the xml file. If its = or greater than the ad "frequency" then you need to push an ad (see later) Ex: If freq is 1 of 3, and the count of posts in the xml is 2 or more, then you need to push an ad. Without Database: Fetch the contents of http://twitter.com/statuses/user_timeline.xml?count={frequency} Then check each post to see if any contain your ads, if not, then you need to push an ad (see later) Ex: If freq is 1 of 3, then your count is 3, if the XML file contains a "tweet" with your ad then you need to wait, if it doesn't then you need to push an ad Pushing(posting) an ad: http://twitter.com/statuses/update.xml?status={insert ad code here} (note: each of the above API references can either be xml or json, its up to you) I hope that helps! -James Hartig
Re: How to count users that are using my client?
I'm working on a site that will do this and much more! I will keep you updated.
Re: => 0
hey alex! The problem is that he happened to have post enabled. @vks comment out curl_setopt($ch, CURLOPT_POST, 1); or change it to curl_setopt($ch, CURLOPT_POST, 0); that will fix your error :)