[WordPress] 外掛分享: Inline Tweets

WordPress 外掛 Inline Tweets 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Inline Tweets」是 2013-03-31 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 80 個安裝啟用數。
  • 上一次更新是 2014-01-11,距離現在已有 4131 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.7 以上版本才可以安裝。
  • 有 5 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

mdjekic |

外掛標籤

embed | inline | styles | tweets | tweeter |

內容簡介

此簡單的外掛可以讓您將推文嵌入到您的文章、頁面和文字小工具中,並應用您自己的自訂樣式。只需將一個簡單的片段添加到您的文章、頁面或文字小工具內容中,即可實現。以下是一個範例:

[tweet]latest|user=WordPress,count=5[/tweet]

此片段將顯示由@WordPress製作的最後五條推文,並提供直觀的HTML標記,您可以輕鬆地應用您自己的自訂CSS樣式。在獲取推文時,後台處理,不會減慢您的網站或博客的顯示速度。在推文加載之前,您將會看到一個不顯眼的過渡占位符。您喜歡這個外掛嗎?請查看“如何使用”和“標記和樣式”以了解您可以做些什麼。

快取會提高獲取推文時外掛的性能,並確保其在Twitter API限制內運作。要啟用緩存,請安裝W3 Total Cache並在外掛設置中啟用“對象快取”。

由於Twitter推出了其API版本1.1,您需要創建一個Twitter應用程序才能使用它,以及使用此外掛。這不難,您只需花費幾分鐘創建應用程序並獲得用於配置Inline Tweets的令牌和金鑰。您只需要做一次,沒有問題。

Milos Djekic是一位來自塞爾維亞貝爾格莱德的軟件解決方案架構師。他喜歡創建有用的軟件。

Credits 標籤注明了相關的資料來源。Inline tweets使用了一個由Abraham Williams創建的優秀Twitter API封裝庫來與Twitter通訊。您可以在這裡找到它。

使用方式取決於您想要顯示什麼內容。只有幾種顯示推文的方式,但應用程序列表將在未來擴展。確保您查看“片段選項”並學習如何控制顯示的內容和方式。

單一推文:當您想要在博客文章或頁面中嵌入一條推文時,請使用以下片段:

[tweet]single|id=tweet_id[/tweet]

將tweet_id替換為您想要顯示的Twitter狀態ID即可。

最新推文:這可能是該外掛最常見的應用程序。如果您想在側邊欄和/或頁面/文章中顯示自己(或他人)的最新推文列表,請使用以下片段:

[tweet]latest|user=twitter_user[/tweet]

將twitter_user替換為您想要顯示其推文的帳戶用戶名。您可以通過添加計數參數來限制將要擷取和顯示的推文數量。請查看以下範例:

[tweet]latest|user=twitter_user,count=10[/tweet]

請注意:預設擷取的推文數量為5,最大值為25。如果您設置了超過最大值,您將獲得預設的5條推文。

顯示選項:有各種選項可以幫助您自定義外掛將為特定片段顯示的內容。您可以包含自定義選項,并對其進行可視化設置。請參閱文檔以了解如何使用。

原文外掛簡介

This simple plugin will enable you to embed tweets into your posts, pages and text widgets and apply YOUR CUSTOM STYLES. It comes down to adding a simple snippet into your post, page or text widget content. Here’s an example:
[tweet]latest|user=WordPress,count=5[/tweet]

This snippet will display five last tweets made by @WordPress with an intuitive HTML markup to which you can easily apply your custom CSS:
.inline_tweet { background-color: whitesmoke; border: 2px solid black; }

Fetching tweets will be done in the background and will not slow down the displaying of your website or blog. You will see an unobtrusive transition placeholder before the tweets are loaded.
You like that? Take a look at the How to use and Markup and Styling to learn what you can do.
Caching
Caching will improve performance when fetching tweets and ensure that the plugin operates within Twitter API limits. To enable caching, please install W3 Total Cache and enable ‘Object Cache’ in plugin settings.
Configuration
SinceTwitter introduced it’s API version 1.1 you need to create a Twitter application to be able to use it and thus to use this plugin. It’s not hard, you will spend a couple of minutes to create an app and obtain tokens and keys you will use for configuring Inline Tweets. You will have to do that only once, so no problem.
Author
Miloš Đekić is a software solutions architect from Belgrade, Serbia. He loves to create useful software.
Credits
Credits should be given when credits are due. Inline tweets use a great Twitter API wrapper library created by Abraham Williams to communicate with Twitter. You can find it here
How to use
The usage depends on what you want to display. Only a couple of ways of displaying tweets exists but the list of applications will be expanded in the future. Make sure you take a look at the “Snippet Options” and learn how to take control over what is displayed and how.
Single Tweet
This is useful when you want to embed a tweet in your blog article or page. Just use this snippet:
[tweet]single|id=tweet_id[/tweet]

Replace “tweet_id” with the ID of the Twitter status you want to display. That’s it.
Latest Tweets
This will probably be the most common application of the plugin. If you want to display a list of your (or someone elses) latest tweets in your sidebar and/or pages/articles, use this snippet
[tweet]latest|user=twitter_user[/tweet]

Replace “twitter_user” with the username of the account whose tweets you want to display. You can limit the number of tweets that will be fetched and displayed by adding a “count” param. Take a look at the following example:
[tweet]latest|user=twitter_user,count=10[/tweet]

Note: Default number of tweets that will be fetched is 5 and the maximum you can set is 25. If you set more that the maximum you will get the default 5 tweets.
Display Options
There are various options to help you customise what will be displayed by the plugin for a particular snippet. You can include a custom option by adding the option string after a comma sign.
Here’s a list of all options with examples:
time_format
You can select the time format inline. Have in mind that if the format you set is not supported the time will be displayed in default format Here’s an example:
[tweet]latest|user=twitter_user,time_format=M Y[/tweet]

hide_author
You can easily remove the author from display by simply adding the option:
[tweet]single|id=tweet_id,hide_author[/tweet]

hide_avatar
You can easily remove the avatar from display by simply adding the option:
[tweet]single|id=tweet_id,hide_avatar[/tweet]

hide_timestamp
You can easily remove the timestamp from display by simply adding the option:
[tweet]single|id=tweet_id,hide_timestamp[/tweet]

full_names
By default tweets are displayed with their authors Twitter names. If “full_names” param is set they will be displayed with their full names:
[tweet]latest|user=twitter_user,count=15,full_names[/tweet]

Markup and Styling

Inline tweets are rendered with a recognizable HTML markup that you can use to display them in virtually every way possible using CSS. For starters, every tweet is wrapped in an element with class “inline_tweet”. Then every displayed element has it’s own class and rules.
Tweet Content
Author
Author’s Twitter name or full name is displayed as a link to his/her Twitter page:
@author

You can style the link by referencing the “inline_tweets_author” class (e.g. different color for plugin author than other users mentions).
Avatar
If displayed, the avatar is rendered as a link to author’s Twitter page also, with the addition of an image element:


You can style the link in terms of positioning and the image display by referencing the “inline_tweets_avatar” class.
Mentions
Mentions are also displayed as link to author Twitter pages and you cal easily style them by referencing the “inline_tweets_mention” class:
@mention

Timestamp
If you decide to display the timestamp, you can easily style it – in terms of positioning for starters – by referencing the “inline_tweets_timestamp” class. Here’s how the timestamp is rendered:
Jan 2014

Single Tweet
Here’s an example of how a single tweet is displayed:

@ArchdukeM



"She represented everything I loved about the English. She was totally deranged."
Jan 2014

Multiple Tweets
When more that one tweet is displayed it is rendered as a list. To cut it short, here’s an example markup:

  • CONTENT

Let’s analyse the differences and the advantages. You have a ul element with a class “inline_tweets_ul” that you can use if you want to position the entire list, enable scrolling or whatever you want. Instead of a div element, there’s a li element with the “inline_tweet” class for wrapping the tweet. Tweet content is rendered in the same way as single tweets.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Inline Tweets」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 2.0 | 1.0.1 | 1.0.2 | 1.1.1 | 1.1.2 | trunk |

延伸相關外掛(你可能也想知道)

  • Tweeter! 》一個風格化的 Twitter 小工具外掛。我創建了這個插件,是因為我想要在我的個人博客上有一個更好看的小工具。它沒有其他一些插件那麼複雜,但它實現了它的目的...。

文章
Filter
Apply Filters
Mastodon