<?php
header(‘Content-Type: text/html; charset=utf-8’);$fn = "1.txt";
$f= fopen($fn, "r");
$line = fgets($f);
ob_start();
fpassthru($f);
fclose($f);
file_put_contents($fn, ob_get_clean() );echo $line;
?>
Facebook Graph API search with cURL
<?php
/**
* facebook.class.php
*/class Facebook
{
public function __construct() {}public function search($query)
{
$curl = curl_init(‘https://graph.facebook.com/search?type=post&q=’.urlencode($query));// Tell curl to return results and not output it
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);// Execute curl and store results in $result
$result = curl_exec($curl);// Close connection
curl_close($curl);// Return the results as a decoded JSON object
return json_decode($result);
}
}?>
Facebook Graph API search with file_get_contents
$content = json_decode(file_get_contents(‘https://graph.facebook.com/search?q=xiaokyun&type=post’));
防止表格或DIV布局的网页页面被撑大
·如果你前台页面是用表格来布局的,那么在CSS文件中加入如下代码:
table { table-layout: fixed; word-break: break-all; overflow: hidden; }
·如果你前台页面是用DIV来布局的,那么在CSS文件中加入如下代码:
div { table-layout: fixed; word-wrap: break-word; overflow: hidden; }
Twitter OAuth API Keys of Official Clients
Twitter for Andriod
key: 3nVuSoBZnx6U4vzUxf5w
secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Twitter for iPhone
key: IQKbtAYlXLripLGPWd0HUA
secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Echofon
key: yqoymTNrS9ZDGsBnlFhIuw
secret: OMai1whT3sT3XMskI7DZ7xiju5i5rAYJnxSEHaKYvEs
Twitter for iPad
key: CjulERsDeqhhjSme66ECg
secret: IQWdVyqFxghAtURHGeGiWAsmCAGmdW3WmbEx6Hck
Twitter for Mac
key: 3rJOl1ODzm9yZy63FACdg
secret: 5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8
Twitter for Windows Phone
key: yN3DUNVO0Me63IAQdhTfCA
secret: c768oTKdzAjIYCmpSNIdZbGaG0t6rOhSFQP0S5uC79g
Tweetbot for iOS
key: 8AeR93em84Pyum5i1QGA
secret: ugCImRuw376Y9t9apIq6bgWGNbb1ymBrx2K5NK0ZI
twicca
key: 7S2l5rQTuFCj4YJpF7xuTQ
secret: L9VHCXMKBPb2eWjvRvQTOEmOyGlH4W50getaQJPya4
YoruFukurou
key: WfEZ02WzcqZMvs4HJMZLA
secret: 69zIxwA9KSuY4IDYRT2Bfk1rq62Nq1csspXOfSRKhg
HootSuite
key: w1Gybt9LP9zG46mS1X3UAw
secret: hRIK4RWjAO4pokQCvmNCynRAY8Jc8edV1kcV2go6g
key: 7YBPrscvh0RIThrWYVeGg
secret: sMO1vDyJ9A0xfOE6RyWNjhTUS1sNqsa7Ae14gOZnw
TweetDeck
key: yT577ApRtZw51q4NPMPPOQ
secret: 3neq3XqN5fO3obqwZoajavGFCUrC42ZfbrLXy5sCv8