內容簡介
Twitter Status 是一個非常簡單的插件,它會從指定的 Twitter ID 獲取當前的 Twitter 訊息,當有人訪問你的網站時,背景中會運行一個 ajax 腳本,每 30 秒進行一次 GET 請求,這個請求會觸發插件來獲取所有帶有 Twitter ID 的作者資料,並更新他們的 Twitter 狀態,前提是它們在至少 30 分鐘內沒有被更新過,每次請求限制為 5 個 Twitter 資料。
你可以通過編輯插件文件(在激活之前)來更改這些設置。這些設置很容易訪問,不需要 PHP 知識。我將在未來的版本中結合一個配置頁面,現在我想發布一個最基本的版本。
使用方法
安裝後,在 wp-admin 中編輯要分配 Twitter 個人資料的作者資料。
您可以在模板中使用以下標籤:
<?php twitter('Username') ?>
<?php twitter('twitter_id=xxxx') ?>
<?php twitter('user_id=xxxx') ?>
這些函數都會回應存儲在資料庫中的給定用戶的當前狀態。
您可以使用以下函數直接從 Twitter 獲取 Twitter 狀態,但請注意,這樣使用會導致頁面載入時間延遲:
<?php echo twitter_status_get('xxx') ?>
在 "xxx" 中輸入 Twitter ID。
外掛標籤
開發者團隊
原文外掛簡介
Twitter Status is a very simple no-fuzz plugin that gets the current Twitter message from the Twitter ID specified, when someone visits your website there will be an ajax script running in the background doing a GET request every 30 seconds, this request will trigger the Plugin to get all Author profiles with a twitter ID, and update their Twitter status, given that they haven’t been updated in at least 30 minutes and with a limit of 5 twitter profiles per request.
You can change these settings by editing the plugin file (before activating it).. the settings are easily accessible, no knowledge of PHP required.. I will incorporate a configuration page in future versions, for now I wanted to make an initial release that’s down to the complete basics.
Usage
After installing, edit the author profiles in wp-admin that you would like to assign a Twitter profile to.
You can use the following tags in your templates:
These functions will all echo the current status stored in the Database for the given user.
You can use the following function to get the twitter status DIRECTLY from twitter, but keep in mind that using this will cause a delay in the loadtime of the page;
For “xxx” enter the twitter ID.
