Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus as webcomic reader: stripping ads, preparing html part
@ 2011-07-10 20:37 Philipp Haselwarter
  2011-07-10 20:47 ` Antoine Levitt
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Haselwarter @ 2011-07-10 20:37 UTC (permalink / raw)
  To: ding

Hey,
I'm trying to set up gnus for reading webcomics, either directly through
RSS or on gwene (seems more comfortable as a longer history is
available).

Inline html-image display did not exactly work right away, I'm using a
bit of a hack right now.

But what I'm really still struggling with at the moment is blocking
chunks of the html.

For example the gwene feed of http://www.questionablecontent.net/ is at
gwene.net.questionableco
and starts with a nice ad banner.

I hoped `gnus-article-strip-banner' could be used to block it, but so
far I have not succeeded. It seems that even when html parts are
treated, only the text-parts gets processed, anything inside html-tags
is not touched.

This is an example of the part I'm trying to get blocked:

#+begin_src html
  <p><!-- Beginning of Project Wonderful ad code: -->
  <br />
  <!-- Ad box ID: 39770 -->
  <br />
  <map name="admap39770" id="admap39770"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=39770&type=5" shape="rect" coords="0,0,728,90" title="" alt="" target="_blank" /></map>
  <br />
  <table cellpadding="0" border="0" cellspacing="0" width="728" bgcolor="#ffffff"><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=39770&type=5" width="728" height="90" usemap="#admap39770" border="0" alt="" /></td></tr><tr><td bgcolor="#ffffff" colspan="1"><center><a style="font-size:10px;color:#0000ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;text-transform: none;letter-spacing:normal;text-shadow:none;white-space:normal;word-spacing:normal;" href="http://www.projectwonderful.com/advertisehere.php?id=39770&type=5" target="_blank">Ads by Project Wonderful!  Your ad could be here, right now.</a></center></td></tr><tr><td colspan="1" valign="top" width="728" bgcolor="#000000" style="height:3px;font-size:1px;paddi
 ng:0px;max-height:3px;"></td></tr></table>
  <br />
#+end_src

To do so I've added this group-parameter

#+begin_src emacs-lisp
(add-to-list 'gnus-parameters
        ("questionable"
         (mm-text-html-renderer 'w3m)   ;shr seems to resize the image

         ;; required to actually display images
         (mm-inline-text-html-with-images nil)
         (gnus-article-prepare-hook 'w3m-toggle-inline-images)

         ;; this won't work just yet
         (gnus-article-treat-types (cons "text/html" gnus-article-treat-types))
         (bannner . "^.*wonderful\\(\n\\|.\\)+<br />")
         ))
#+end_src

The banner does not work because I'm trying to get at the html tags.

How can I get this filter working?


-- 
Philipp Haselwarter




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Gnus as webcomic reader: stripping ads, preparing html part
  2011-07-10 20:37 Gnus as webcomic reader: stripping ads, preparing html part Philipp Haselwarter
@ 2011-07-10 20:47 ` Antoine Levitt
  0 siblings, 0 replies; 2+ messages in thread
From: Antoine Levitt @ 2011-07-10 20:47 UTC (permalink / raw)
  To: ding

10/07/11 22:37, Philipp Haselwarter
> Hey,
> I'm trying to set up gnus for reading webcomics, either directly through
> RSS or on gwene (seems more comfortable as a longer history is
> available).

I use it for that purpose also. I use shr, and usually open "large" (ie
not single strips) webcomics such as questionable content in a browser
(gnus-article-browse-html-article).

>
> Inline html-image display did not exactly work right away, I'm using a
> bit of a hack right now.
>
> But what I'm really still struggling with at the moment is blocking
> chunks of the html.
>
> For example the gwene feed of http://www.questionablecontent.net/ is at
> gwene.net.questionableco
> and starts with a nice ad banner.
>
> I hoped `gnus-article-strip-banner' could be used to block it, but so
> far I have not succeeded. It seems that even when html parts are
> treated, only the text-parts gets processed, anything inside html-tags
> is not touched.
>
> This is an example of the part I'm trying to get blocked:

Have you tried customizing gnus-blocked-images? I have it as
"doubleclick\\.net\\|feedsportal", and that blocks out a portion of
ads. It works with shr, no idea with w3m.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-10 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 20:37 Gnus as webcomic reader: stripping ads, preparing html part Philipp Haselwarter
2011-07-10 20:47 ` Antoine Levitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).