[Safari]YouTubeのユーザーチャンネルのRSSを登録するAppleScript 新旧混在版
set theURL to ""
set theUserID to ""
set theGoogleReaderURL to "https://www.google.com/reader/view/feed/"
set theGoogleApiURL to "https://gdata.youtube.com/feeds/base/users/"
--------------------------全面のURLを取得
tell application "Safari"
activate
set theURL to (URL of document 1) as Unicode text
end tell
------URLにuserが入るかどうか?でユーザーチャンネルか?古いタイプのプレイリストか?を判定
set theSearch to "/user/"
set theSerRes to offset in theURL of theSearch
-------URLにuserが入っていない場合は新しいプレイリストなのでoembedが利用出来ます。
if theSerRes is 0 then
-----------------新しいタイプ-USERIDの取得の処理
set theListFLIDcom to "curl " & "'http://www.youtube.com/oembed?url=" & theURL & "&format=json'" & " | awk -F\"author_name\" '{print $2}'| awk -F, '{print $1}' | tr -d '\" :'" as Unicode text
set theUserID to do shell script theListFLIDcom
else
-----------------古いタイプのチャンネルやプレイリストからUSERIDを取得する場合
set theUserChCom to "echo " & theURL & " | awk -F/ '{print $5}'| awk -F# '{print $1}'"
set theUserID to do shell script theUserChCom
end if
--------------------------GoogleReader用のURLへ整形します
set theUserRssURL to theGoogleReaderURL & theGoogleApiURL & theUserID & "/uploads"
--------------------------GoogleReader用のURLを開きます
tell application "Safari"
launch
activate
make new document
delay 1
tell window 1
open location theUserRssURL
end tell
end tell
これで主要なYoutubeのページから
ユーザーのアップロードRSSを取得する事が出来ます。
「GetYouTubeFeedsSafariv3.scpt.zip」をダウンロード
「GetYouTubeFeedsSafariv3.rtf」をダウンロード
スクリプトメニューに入れて使います。
スクリプトメニューの出し方はこちら
| 固定リンク
« [Safari]YouTubeのユーザーチャンネルのRSSを登録するAppleScriptその2 | トップページ | [Google Chrome]YouTubeのRSS feedを登録するAppleScript »
「AppleScript」カテゴリの記事
- 濁音 半濁音 置換用レコード(2023.08.21)
- [AppleScript]キーノートの書類サイズを指定して作成(2022.01.09)
- [awk]行頭のスペースを削除する(subで置き換え)(2021.11.16)
- [SpotLight]選択範囲でSpotLight検索(2021.11.03)
- [AppleScript]リソースフォーク(カスタムアイコン)削除(2021.10.12)
「YouTube Rss」カテゴリの記事
- YouTubeのユーザーチャンネルアップロードFEEDを取得する(2012.01.20)
- [Google Chrome]YouTubeのRSS feedを登録するAppleScript(2012.01.20)
- [Safari]YouTubeのユーザーチャンネルのRSSを登録するAppleScript 新旧混在版(2012.01.19)
- [Safari]YouTubeのユーザーチャンネルのRSSを登録するAppleScriptその2(2012.01.19)
- [Safari]YouTubeのユーザーチャンネルのRSSを登録するAppleScript(2012.01.18)



[RSS]