feedryで広告と重複エントリを既読にするGreasemonkeyスクリプト作った - そうだ?Blogを書こう?
このへんの記事を参考にjQUeryでfeedlyのエントリに流れてくるPR記事を自動的にクリックしてくれるやつ作ってみた。
// ==UserScript== // @author uokada // @name Ore no feedly Auto Read Ads // @namespace http://uokada.hatenablog.jp/ // @version 0.2.0 // @include http://feedly.com/#latest // @include http://feedly.com/#subscription* // @include http://feedly.com/#category* // @require http://code.jquery.com/jquery-1.10.1.min.js // ==/UserScript== (function(){ // 【スタッフより】よりは自分が読んでるブログでよく上がってくるので追加 var pat = /^(Pr:|AD:|\[PR\]|【スタッフより】)/i; $("div[data-defaultview='u0Entry']").each(function(){ var anchor_text = $(this).attr("data-title"); //alert(anchor_text + anchor_text.toUpperCase().match("/^(PR:|AD:|\[PR\])/i")); if(anchor_text.match(pat)){ $(this).trigger("click"); } }); })();
本家の方に getElementsByClassName('inlineFrame') してゴニョゴニョしてるコードがあるんだがfeedlyの仕様変更で消えたクラス探してるっぽいので削った。
Webデザイナーのための jQuery入門 魅力的なユーザーインターフェースを手軽に作る (Books for Web Creative)
- 作者: 高津戸壮
- 出版社/メーカー: 技術評論社
- 発売日: 2011/12/07
- メディア: 大型本
- 購入: 4人 クリック: 62回
- この商品を含むブログを見る
なんか動かない。。。 深夜確認した勢いで書いてみたけど何がダメなんだ?