uokadaの見逃し三振は嫌いです

ここで述べられていることは私の個人的な意見に基づくものであり、私が所属する組織には一切の関係はありません。

Feedlyの広告エントリをクリックするGreasemonkeyスクリプトをjQueryで書いてみた

feedryで広告と重複エントリを既読にするGreasemonkeyスクリプト作った - そうだ?Blogを書こう?

このへんの記事を参考にjQUeryfeedlyのエントリに流れてくる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の仕様変更で消えたクラス探してるっぽいので削った。

なんか動かない。。。 深夜確認した勢いで書いてみたけど何がダメなんだ?