2012-04-22

Blogger でサイトマップを表示するツールを、投稿が 500 件以上あるブログにも対応させてみた

こないだ、Blogger Tips でこんなのを書いた。 紹介したのは、短いコードを挿入するだけで、自動的にブログの投稿をラベル別に一覧にしてくれる便利なツール。とはいえ、何分 Blogger のフィードを JSONP で出力させているため、投稿が 500 件までしか取得できないという制約が…。

それで、blogtoc のコードを眺めまわして、コールバックに指定されている関数でデータの取得と表示を一手に行っていたのを、取得のみにして、複数のフィードのデータを読み込んだ後に表示の関数を呼び出すことにした。

元がこちら(オリジナルを整形したもの)。 で、複数フィードを指定できるようにしたのが、こちら。
導入方法

Blogger の管理画面「ページ」タブのリンクを「新しいページ」→「空白のページ」と進み、出てきたページエディタを「HTML」モードにした上で、本文の位置に、以下のコードを入力。赤字の部分は自身のブログの URL に変更すること。

<script type="text/javascript" src="http://tools.kuribo.info/blogtoc/blogtoc-plus.js"></script>

<script type="text/javascript" src="http://www.kuribo.info/feeds/posts/summary?alt=json-in-script&callback=loadtoc&max-results=500&redirect=false"></script>
<script type="text/javascript" src="http://www.kuribo.info/feeds/posts/summary?alt=json-in-script&callback=loadtoc&max-results=500&start-index=501&redirect=false"></script>
<script type="text/javascript" src="http://www.kuribo.info/feeds/posts/summary?alt=json-in-script&callback=loadtoc&max-results=500&start-index=1001&redirect=false"></script>

<script type="text/javascript">showPosts();</script>

3 行目からの各フィードで、投稿を 500 件ずつ取得するので、start-index パラメータで、投稿の開始番号を 500 番ずつずらして指定すること。ブログで必要な投稿分この行を増やすといいかと。ちなみに、指定なしは start-index=1 と解釈される。

最後に JavaScript の showPosts 関数(blogtoc-plus.js で定義)を呼び出して、取得した投稿データをソートして書き出す、と。

ブログの投稿数が 500 件を超えている人は、一度お試しを。

参考:
追記(2012-06-03)

こういうコメントが。
NEW!がかなり古い投稿にもついてしまうのですが、なぜでしょうか?
タイトルと一緒に投稿日付を表示することはできせんでしょうか?
別ウィンドウで開くようにすることは可能ですか?
フィードごとに、新しい投稿 10 件「NEW!」が表示されるようになっていました。元々のコードは複数のフィードを読み込むようになっていないので、まあ当然といえば当然。最初のフィードの新投稿 10 件だけ「NEW!」をつけるように修正しました。

「導入方法」で示したコードの

<script type="text/javascript">
  var openNewWindow = true;
  var showDate = true;
</script>

というのを挿入すると、リンクを新しいウィンドウで開く、投稿の日付を表示するというオプションが有効になるようにしました。

参考:
スポンサードリンク:

お願い:
「このエントリ役に立った!」と思ったら、ぜひ フィード 登録をお願いします。 

60 comments:

  1. これは凄いですね、試しにやってみましたが本当に簡単に出来ました。
    ありがとうございます。

    ReplyDelete
  2. 一応テストはしたものの、ちょっと自信がなかったため、こちらで公開しました。ちゃんと動いているようでよかったです。コメントありがとうございます。

    ReplyDelete
  3. いつも参考にさせてもらってます。すごーい、便利ですね。投稿編集画面とはまた違って、過去投稿を整理するのにも役立ちそうです。ありがとうございます。
    3つ質問です。
    NEW!がかなり古い投稿にもついてしまうのですが、なぜでしょうか?
    タイトルと一緒に投稿日付を表示することはできせんでしょうか?
    別ウィンドウで開くようにすることは可能ですか?
    http://dutchphotos.blogspot.nl/p/blog-page_02.html
    お時間の許すときに教えていただければ助かります。よろしくおねがいします。

    ReplyDelete
  4. コメントありがとうございます。コード修正しました。
    記事に使い方を追記していますので、ご確認ください。
    これからも、よろしくお願いします。

    ReplyDelete
  5. 早速のご対応感謝です。
    で、コード追加こころみたのですが・・うまくいきません (;^_^A

    3点とも解決できませんでした。これをヒントになんとか自力解決しようと思ったものの、ギブアップ。重ね重ねすみません・・
    うまく表示されない可能性はなんでしょうか?よろしくお願いします。

    ReplyDelete
  6. え、前回示された URL 上で、新しいコード、ちゃんと動いているようですが…。スクリプトの古いキャッシュがブラウザに残っているのではないかと思います。

    http://tools.kuribo.info/blogtoc/blogtoc-plus.js

    を再読み込みしたあと、サイトマップページを表示してみてくださーい。

    ReplyDelete
  7. あと、Google Analytics のトラッキングコードでエラーが出ているようです。
    コードを加工せずに(<br /> とか入れずに)そのまま貼り付けると、改善されると思います。

    ReplyDelete
  8. 実は、私もキャッシュ?と思って試行錯誤してみたのですが・・別のPCでみたら上手くいきました。
    お手数かけました。

    こちらで紹介させていただきました。
    http://dutchphotos.blogspot.nl/2012/06/blogger.html
    2007年にやっぱりクリボウさんにお世話になった形跡が・・・これも一覧のおかげです。本当に感謝。これからもよろしくおねがいします。
    http://dutchphotos.blogspot.nl/2007/07/blog-post_3704.html

    ReplyDelete
  9. ありがとうございます。標準 Blogger にはこういう一覧機能がないのでかったるいなあと思っていたのですが、これで解決しました。小生の三つのブログにさっそく導入させていただきました。

    ReplyDelete
  10. 少し blogger をしてないと、昔は出来たこともすっかり忘れてしまい途方にくれます。
    クリボウさんの記事は忘れんぼうに超お役立ちです。
    僕も設置させて頂きました。
    ありがとうございます!

    ReplyDelete
  11. はじめまして。とても役に立つ機能ですね。

    4コマ漫画のサイトをやっておりまして、新しくいらした方が古い記事から読めるように
    できたらなあと思うのですが、一番古い記事から表示することは可能でしょうか?
    現在は、ラベル別にあいうえお順に並んでいるみたいなのですが...

    http://sakura4koma.blogspot.jp/p/blog-page_21.html

    解決法がございましたら、ご教示いただけますでしょうかm(_ _)m

    ReplyDelete
  12. 大変、参考になりました。ありがとうございました。

    ReplyDelete
  13. 世界の情報・笑い・幸せをブログに載せております!最近では少しづつアクセスも増えてきております^^よかったら一度是非見に来ていただければと思いますm(__)m
    www.kamiomo.com

    ReplyDelete
  14. 世界の情報・笑い・幸せをブログに載せております!最近では少しづつアクセスも増えてきております^^よかったら一度是非見に来ていただければと思いますm(__)m
    www.kamiomo.com

    ReplyDelete
  15. mcafee.com/activate registered trademarks, company names, product names and brand names are the property of their respective owners, and mcafee.com/activate disclaims any ownership in such third-party marks. The use of any third party trademarks, logos, or brand names is for informational purposes only, and does not imply an endorsement by mfmcafee.com or vice versa or that such trademark owner has authorized mfmcafee.com to promote its products or services.


    office.com/setup is an independent support and service provider for the most secure remote technical services for all Office products. Our independent support services offer an instant support for all software related errors in the devices, laptops, desktops and peripherals. We have no link or affiliation with any of the brand or third-party company as we independently offer support service for all the product errors you face while using the Office. If your product is under warranty, then you may also avail our support services for free from manufacturer’s official website office.com/setup.

    mcafee.com/activate is an independent support and service provider for the most secure remote technical services for all norton products. Our independent support services offer an instant support for all software related errors in the devices, laptops, desktops and peripherals. We have no link or affiliation with any of the brand or third-party company as we independently offer support service for all the product errors you face while using the norton. If your product is under warranty, then you may also avail our support services for free from manufacturer’s official website norton.com/setup.

    ReplyDelete
  16. norton.com/setup -Norton.com/setup - Find all the steps to download, install, and activate Norton antivirus. Go to norton.com/setup, log in, redeem your product key, and download the setup .

    office.com/setup - office.com/setup - To get started Office 2019, 2016 and office 365 download or installation you must need valid 25 character product key, visit on office.com/setup.

    mcafee.com/activate - mcafee.com/activate - Type the 25-digit alphanumeric product key on www.mcafee.com/activate and get started with the download, install, activation procedure of McAfee antivirus.

    ReplyDelete
  17. mcafee.com/activate - McAfee Retail Card activation at www.mcafee.com/activate, enter your product key for Activate. Download & Install McAfee Antivirus Software.
    Visit norton.com/setup to install fee or paid version of the software. Know how to install norton setup and Norton core to secure your Wi-Fi network.
    office.com/setup - Download Setup, Redeem Product Key and Install Office on your computer from www.office.com/setup with Microsoft Account.

    ReplyDelete

  18. Hello, I'm Smith Machinist . If you are facing issues with any office product then you can visit my website.
    norton.com/setup | Office.com/setup | McAfee.com/activate

    ReplyDelete
  19. The affiliation offers a fantastic fumble of package answer that confirmation your work areas, workstations and phones from the awful deadly on-line risks. With a Norton Antivirus on changed data directing system, one will get their workstation and might manage the security in like way as insurance of the learning.
    www.norton.com/setup

    ReplyDelete
  20. w-nortoncom.com is a free online help supplier On-Demand Remote Technical Services For Norton items...
    norton.com/setup

    ReplyDelete
  21. The affiliation offers a fantastic fumble of package answer that confirmation your work areas, workstations and phones from the awful deadly on-line risks. With a Norton Antivirus on changed data directing system, one will get their workstation and might manage the security in like way as insurance of the learning.
    www.norton.com/setup

    ReplyDelete
  22. w-nortoncom.com is a free online help supplier On-Demand Remote Technical Services For Norton items...
    norton.com/setup

    ReplyDelete
  23. What a superb post! I have no words to describe this post because everthing is clear with your wonderfull words. I really feel out for world reading your post, it is full of fresh and usefull. I really appreciate, keep the work continue.

    norton.com/setup ! www.norton.com/setup ! office.com/setup ! office.com/setup ! mcafee.com/activate ! mcafee.com/activate





    ReplyDelete
  24. office.com/setup is an independent support and service provider for the most secure remote technical services for all office products. our independent support services
    office.com/setup

    office.com/setup

    mcafee.com/activate

    mcafee.com/activate

    mcafee.com/activate

    mcafee.com/activate

    ReplyDelete
  25. Nice Post!
    As we all know, Microsoft Office is among the greatest productivity applications available in market at this time, Followed by a number of other applications with fantastic chances. However, Office can do wonders in a lot of ways. To a lot of people in the world. Working on PC/MAC is something that they do daily basis, yet this computer work ought to be accomplished easily and quick. This isn't so simple without softwares. And for companies and other workplaces, Productivity softwares have accepted the floor to find work done over the time limitation or even quicker than the given time.
    Setup And Install Your Office Product With Activation Key.
    office com setup

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. AOL Tech Support Phone Number is a toll-free helpline accessible 24/7. The experts at this helpline number are technically sounded and fix all your AOL mail account related issues. Reach for their help at AOL Tech Support Phone Number, anytime you require. For more info
    aol-contact.support

    ReplyDelete
  28. He writes about the latest updates regarding office.com/setup and how it can improve the work experience of users. His articles have been published in many popular e-magazines, blogs and websites.

    ReplyDelete
  29. Install office setup – Sign-in to you microsoft account and then Enter 25 digit alphanumeric office setup product key on office.com/setup. Select country and language.click on next to start office installation.

    ReplyDelete
  30. In like manner, you can visit the association office.com/setup to use the thing on the web. With the true objective to download and start the thing, you require a thing key.

    ReplyDelete
  31. Our Technical social affair is constantly organized to help and guide you as norton.com/setup run the show. Our Team is especially gifted and limit in taking care of the issues.

    ReplyDelete
  32. We are available 24/7 to help you out the complete procedure of download and install of office.com/setup. And also Check out here complete steps for mcafee.com/activate for downloading, installing, uninstalling, and activating, and also get antivirus help for norton.com/setup. For norton activation, get the 25 characters alphanumeric product key from office.com/setup. Norton offers hordes of reliable antivirus programs

    ReplyDelete
  33. You can also visit office.com/setup to find out about Office and its applications. Here you will discover various articles committed to helping you all through your Office experience.

    ReplyDelete
  34. Install office setup – Sign-in to you microsoft account and then Enter 25 digit alphanumeric office setup product key on office.com/setup. Select country and language.click on next to start office installation.

    ReplyDelete
  35. In like manner, you can visit the association office.com/setup to use the thing on the web. With the true objective to download and start the thing, you require a thing key.

    ReplyDelete
  36. Our Technical social affair is constantly organized to help and guide you as norton.com/setup run the show. Our Team is especially gifted and limit in taking care of the issues.

    ReplyDelete
  37. Get Easy Assistance for Canon IJ Setup with us
    If you are looking out for the best assistance with Canon IJSetup with us. We at are available for for your assistance with a round the clock availability. You can reach out to us with any issues relating to your Canon Driver Support and our team will provide you the best assistance with its installation and usage.you can call toll free number +1-888-845-6052.

    ReplyDelete
  38. We are here providing services to resolve your problem of Printer. For any further update or help you can contact our HP Printer Support Number which is toll-free +1-888-845-6052.

    ReplyDelete
  39. Customer service is a tech blogger which pursue experience of about 10 years in the tech field and also she is a manager at Tech Support. To know more about him you can track him at www.Norton.com/Setup With Product Key If you need any thing you can call toll free number +1-888-845-6052.

    ReplyDelete
  40. Norton antivirus software has been eliminating malware, viruses and other kinds of online.Get started Norton Setup with Product Key at norton.com/setup or call us toll-free number for instant support.if you have any query related to norton antivirus then contact us.

    www.norton.com/setup
    www.norton.com/setup
    www.office.com/setup
    www.office.com/setup

    ReplyDelete
  41. http://0rz.tw/D9J4q
    http://shrtlnk.net/4082030
    https://bit.ly/33sDmFx
    https://hostimize.com/7h+
    https://vae.me/cwoV

    ReplyDelete
  42. Assignment Help reflects amazing source of information for writing an effective project. For more information, visit our website greatassignmenthelp and receive informative assignment to score high marks.
    Assignment Help Online
    Online Assignment Help
    Assignment Help Online Services
    Assignment Helper
    Assignment Assistance
    Assignment Help Experts
    Online Assignment Help Services

    ReplyDelete
  43. I am very thankfull to you for sharing this fantastic article , I appereciate your work .

    mcafee.com/activate

    ReplyDelete
  44. It read your article every thing is clear , Thanks for sharing.

    office.com/setup , office.com/setup

    ReplyDelete
  45. Positive web page source, where did u come up with the information on this posting? Before you set up McAfee Antivirus protection on your device, you first need to make sure that you don’t have an older version of McAfee on your device. mcafee.com/activate | mcafee.com/activate | mcafee.com/activate

    ReplyDelete
  46. Thank you so much for sharing such superb information's with us. Download the Microsoft Office setup on your Windows or Mac computer. Make sure that the Office product key is already copied for the activation procedure. office.com/setup | office.com/setup | office.com/setup

    ReplyDelete

  47. norton.com/setup - Get protection after downloading, installing and activating Norton setup. Enter the product key at norton.com/setup.
    Go for more instructions:
    norton.com/setup |
    norton.com/setup

    ReplyDelete
  48. Office helpline Numbers and websites

    office.com/setup


    office.com/setup

    office.com/setup

    office.com/setup


    Install and activate Microsoft office 365 at office.com/setup .
    Redeem you 25 digit product key visit us at
    www.office.com/setup

    ReplyDelete
  49. Office helpline Numbers and websites

    office.com/setup


    office.com/setup

    office.com/setup

    office.com/setup


    Install and activate Microsoft office 365 at office.com/setup .
    Redeem you 25 digit product key visit us at
    www.office.com/setup

    ReplyDelete
  50. I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.

    norton.com/setup

    norton.com/setup

    mcafee.com/activate

    kaspersky activation code

    pogo not loading

    roadrunner email

    aol mail password recovery

    ReplyDelete
  51. I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.

    norton.com/setup

    norton.com/setup

    mcafee.com/activate

    kaspersky activation code

    pogo not loading

    roadrunner email

    aol mail password recovery

    ReplyDelete
  52. I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.

    norton.com/setup

    norton.com/setup

    mcafee.com/activate

    kaspersky activation code

    pogo not loading

    roadrunner email

    aol mail password recovery

    ReplyDelete
  53. It was a very good post indeed. I thoroughly enjoyed reading it in my lunch-time. I Will surely come and visit this blog more often.
    Also, Visit our Windows web page:
    Windows Help and Support

    Microsoft account support

    Windows Support
    Microsoft outlook office 365
    Outlook office

    ReplyDelete
  54. Thanks for sharing this post. Get essay writing help from expert essay writers USA at studentsassignmenthelp.com.

    ReplyDelete

Zenback - Everyone's Related Posts