// f(ucking) u(ncrackable) e(ncryption) function by BlackHatDBL () function fue($hash,$times) { // Execute the encryption(s) as many times as the user wants for($i=$times;$i>0;$i--) { // Encode with base64... $hash=base64_encode($hash); // and md5... $hash=md5($hash); // sha1... $hash=sha1($hash); // sha256... (one more) $hash=hash("sha256", $hash); // sha512 $hash=hash("sha512", $hash); } // Finaly, when done, return the value return $hash; }
10a.Tweeter Feed Runner——使用任意twitter名,可在任意页面上加载用户资源。
pversion; } public function loadTimeline($user, $max = 20){ $this->twitURL .= 'statuses/user_timeline.xml?screen_name='.$user.'&count='.$max; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->twitURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $this->xml = curl_exec($ch); return $this; } public function getTweets(){ $this->twitterArr = $this->getTimelineArray(); $tweets = array(); foreach($this->twitterArr->status as $status){ $tweets[$status->created_at->__toString()] = $status->text->__toString(); } return $tweets; } public function getTimelineArray(){ return simplexml_load_string($this->xml); } public function formatTweet($tweet){ $tweet = preg_replace("/(http(.+?))( |$)/","$1$3", $tweet); $tweet = preg_replace("/#(.+?)(\h|\W|$)/", "#$1$2", $tweet); $tweet = preg_replace("/@(.+?)(\h|\W|$)/", "@$1$2", $tweet); return $tweet; } }
10b. Tweeter Feed Runner——用于在主题中创建文件,比如:example.php
loadTimeline("phpsnips")->getTweets(); foreach($feed as $time => $message){ echo "<div>".$twitter->formatTweet($message)."<br />At: ".$time."</div>"; }
直接拿来用,10个PHP代码片段,还犹豫什么,果断收藏吧
您可能感兴趣的文章: