Skip to content

Instantly share code, notes, and snippets.

@komagata
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komagata/e5acfcbb6b9bdd78f66a to your computer and use it in GitHub Desktop.
Save komagata/e5acfcbb6b9bdd78f66a to your computer and use it in GitHub Desktop.
nFinder2のお気に入りをOPMLにエクスポートする

nfinder2opml

Windows専用ニコニコ動画非公式専用ブラウザのnFinder2のお気に入りをOPMLとしてエクスポートします。

Requirement

ruby 2.0.0 or greater.

Usage

nFinderをインストールしたディレクトリにあるContentsMenu.xmlを指定するとOPMLを出力します。

$ ./nfinder2opml.rb nFinder2/ContentsMenu.xml > mylist.opml

FeedlyなどのFeedReaderにインポートすれば失踪疑惑のかかったうp主のマイリストの監視が用意になります。 「再生2桁台ゲットwwww」

#!/usr/bin/env ruby
path = ARGV[0]
outlines = open(path).read
.scan(/ml\*(\d+)/).flatten
.map { |n| "http://www.nicovideo.jp/mylist/#{n}?rss=atom" }
.map { |url| %Q{<outline text="#{url}" title="#{url}" xmlUrl="#{url}" htmlUrl="#{url}" />} }
.join("\n ")
puts DATA.read.sub(/%{outlines}/, outlines)
__END__
<?xml version="1.0" encoding="utf-8"?>
<opml version="2.0">
<head><title>mylist feeds</title></head>
<body>
%{outlines}
</body>
</opml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment