內容簡介
美國國家公共廣播電台 (National Public Radio) 提供大部分廣播節目的免費文字稿。NPR Transcription 外掛提供簡單的 shortcode 語法,讓您可以將這些文字稿插入 WordPress 頁面和文章中,並且可以自訂主題風格或自訂樣式。
NPR-Transcript WordPress Plugin 需要美國國家公共廣播電台 (National Public Radio) 的 API 金鑰才能運作。當您[註冊 NPR 帳戶] (http://www.npr.org/templates/reg/ “register with NPR”) 後即可免費取得 API 金鑰。
請注意,NPR 的内容使用受到限制,必須符合 NPR 的[條款和條件] (http://www.npr.org/api/apiterms.php “NPR Terms and Conditions”)。請仔細閱讀這些條款以確保您的使用符合 NPR 的要求。美國國家公共廣播電台非常慷慨,WordPress 社區應尊重他們的條款和條件。
使用方式:
在任何文章或頁面中加入 shortcode [npr-transcript story=storynum]。其中,故事編號可在 NPR 網站的 URL 中找到,如屏幕截圖中顯示的故事編號為 150002308。
選填參數:
class = 文字稿文字的 p 標籤的 CSS 類別。如果沒有指定,預設為 npr_para
lp_class = 文字稿底部指回 NPR 故事的鏈接的 p 標籤的 CSS 類別。 NPR 的條款和條件要求此鏈接始終存在,外掛會自動將該鏈接插入到 p 標籤中。如果未指定,預設為 npr_lp。
l_class = 文字稿底部指回 NPR 故事的鏈接的 a> 標籤的 CSS 類別。如果未指定,預設為 npr_l。
link_phrase = 文字稿底部指回 NPR 故事的鏈接的鏈接文字。如果未指定,預設為 Listen on NPR.ORG。
範例:
使用所有選填參數的範例如下:
[npr-transcript story=150002308 class=myTranscriptClass lp_class=myLinkParaClass l_class=myLinkClass link_phrase=”Give it a listen…”]
當然,您必須在您 WordPress 主題的 CSS 中定義這些類別 (或使用 3 個預設類別:npr_para、npr_lp 和 npr_l),否則文字稿和鏈接將呈現您的主題套用的樣式。下面是 HTML 的範例輸出:
此外掛輸出的 HTML 大致如下:<p class=”npr_para”>KASELL: Kate, you had three correct answers, so I’ll be doing the message on your voicemail or answering machine.</p>
<p class=”npr_para”>SAGAL: Well done.</p>
<p class=”npr_para”>(APPLAUSE)</p>
<p class=”npr_para”>BREEN: Thank you.</p>
<p class=”npr_para”>SAGAL: Kate, thank you so much for playing.</p>
<p class=”npr_para”>BREEN: All right, thank you.</p>
<p class=”npr_para”>SAGAL: Bye-bye.</p>
<p class=”npr_para”>BREEN: Bye.</p>
<p class=”npr_para”>(SOUNDBITE OF MUSIC) Transcript provided by NPR, Copyright National Public Radio.</p>
<p class=”npr_lp”><a class=”npr_l” target=”_blank” href=”http://www.npr.org/2012/05/26/153730322/whos-carl-this-time”>Listen on NPR.ORG</a></p>
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
National Public Radio offers free transcriptions of most of its radio shows. The NPR Transcription plugin offers a simple shortcode syntax for inserting these transcriptions into WordPress pages and posts, either with theme based styling or custom styling.
The NPR-Transcript WordPress Plugin will not run without an API key from National Public Radio. Obtaining an API key is free when you [Register with NPR] (http://www.npr.org/templates/reg/ “register with NPR”)
Use of NPR content is restricted by NPR’s [Terms and Conditions] (http://www.npr.org/api/apiterms.php “NPR Terms and Conditions”). Please review these to ensure your usage is in compliance with NPR’s requirements. National Public Radio is quite generous and the WordPress community should respect their T&Cs.
Usage:
Place the shortcode [npr-transcript story=storynum] into any post or page. storynum can be found on the NPR website inside the URL for a particular story as shown in the attached screen shot where the storynum is 150002308.
Optional Parameters:
class = css class of the p tags in transcript text. If not specified, defaults to npr_para lp_class = css class of the p tag in link back to the NPR story at the bottom of the transcript. NPR T&C asks that this link always be present and the plugin automatically inserts the link within a p tag. If not specified, the default class is npr_lp. l_class = css class of the a> tag in link back to the NPR story at the bottom of the transcript. If not specified this class defaults to npr_l link_phrase = text of the link back to the NPR story at the bottom of the transcript. If not specified this text defaults to Listen on NPR.ORG
Example:
An example using all the options might look like:
[npr-transcript story=150002308 class=myTranscriptClass lp_class=myLinkParaClass l_class=myLinkClass link_phrase=”Give it a listen…”]
Of course, you will need to define these classes (or the 3 default classes: npr_para, npr_lp, and npr_l in your theme’s CSS, or the transcript and link will appear in whatever styling your theme applies to p and a tags. Sample HTML output:
The HTML that this plugin outputs looks something like this:
KASELL: Kate, you had three correct answers, so I’ll be doing the message on your voicemail or answering machine.
SAGAL: Well done.
(APPLAUSE)
BREEN: Thank you.
SAGAL: Kate, thank you so much for playing.
BREEN: All right, thank you.
SAGAL: Bye-bye.
BREEN: Bye.
(SOUNDBITE OF MUSIC) Transcript provided by NPR, Copyright National Public Radio.
