Skip to content

Instantly share code, notes, and snippets.

@shellexy
Created April 15, 2012 08:14
Show Gist options
  • Save shellexy/2390876 to your computer and use it in GitHub Desktop.
Save shellexy/2390876 to your computer and use it in GitHub Desktop.
让 dabr api 限额提高到 1000
diff --git a/dabr/common/twitter.php b/dabr/common/twitter.php
--- a/dabr/common/twitter.php
+++ b/dabr/common/twitter.php
@@ -376,6 +376,10 @@ function twitter_process($url, $post_dat
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_data);
}
+ if($post_data == false)
+ {
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-PHX: true'));
+ }
if (user_type() != 'oauth' && user_is_authenticated())
{
@@ -463,6 +467,7 @@ function twitter_fetch($url) {
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-PHX: true'));
$response = curl_exec($ch);
curl_close($ch);
return $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment