
Code to block unwanted News Genius annotations - runandcode
https://github.com/marlabrizel/genius-blocker
======
MaxfordAndSons
What is the motivation behind this? It strikes me as something like an anti-
ad-blocker tool, except instead of serving to protect your sites ad revenue
it's just trying to suppress free discourse about your content through a third
party tool that happens to be exposed to this kind of suppression, but isn't
actually invasive, and is only used by people who opt-in to it anyway.
Basically it seems to me like a tool for people to protect their ability to
successfully disseminate misinformation. Which, I guess is your prerogative
and all, but I personally find disheartening. Having an effective universal
annotation platform in wide use across the web could go a long way towards
improving the SNR for all users.

~~~
chimeracoder
> What is the motivation behind this?

The README links to the explanation:
[https://ellacydawson.wordpress.com/2016/03/25/how-news-
geniu...](https://ellacydawson.wordpress.com/2016/03/25/how-news-genius-
silences-writers/)

~~~
MaxfordAndSons
Odd, I don't see the link there.

But anyway, reading Ms. Dawson's post does make me seriously reconsider the
ethical motivations for making this tool. I suppose my initial negative
reaction was more based on the 'platonic ideal of a universal web annotation
layer' as gkop puts it, rather than an actual understanding of how the Genius
platform operates.

Here's another article with additional context:
[http://www.vox.com/2016/3/31/11336852/genius-annotation-
cont...](http://www.vox.com/2016/3/31/11336852/genius-annotation-controversy)

~~~
welanes
Thanks for the link. The protestations are a little silly from what I gather.

So this is the crux of it: Genius allows people to comment on stuff that
people write - like an improved comment section. Occasionally these comments
suck and are offensive.

From the blog post: "News Genius adds one more way for people on the Internet
to be made unsafe." and "A tool that allows my abusive ex-boyfriend to
interact with me and my content is a tool that should not exist."

The solipsism is laughable. The Internet will forever provide an infinite
supply of trolls but when you _publish_ on a _public platform_ as opposed to
behind a password protected blog or via email, people will talk about what you
write (if you're lucky. many people publish in obscurity) and it just so
happens that you may not always agree with what they say.

The reflex to shut down rather than, say, ignore dissenting opinion is an odd
but increasingly more common one.

~~~
MaxfordAndSons
Yea, I agree that her reasoning isn't entirely well founded. But I'm
nonetheless empathetic, because she's an embattled blogger fighting trolls to
justify her work all the time, and the gap between that experience and the
idealistic motivations for a universal annotation platform must be enormous.

From our tech-centric perspectives, the value of a universal annotation
platform seems self evident, but for a layman's perspective, it just seems
like another toxic commenting layer that content creators can't moderate
(which, in the ideal, it is). The fact that it's then collocated with their
content, instead of, say, a click away on HN or twitter, makes it feel more
violating.

The truly ideal platform would have massive adoption with benevolent power
users that both prevented abuse and generated value adding content by
verifying factual claims, adding appropriate context, etc. This ideal use case
is pretty far from Genius's original platform (explaining rap lyrics in an
entertaining fashion), and that mismatch of intents seems to be the source of
the problem.

------
runandcode
Hey colinbartlett, OP here.

Definitely a good point. Interestingly, I didn't set out intending to use JS
to solve this problem. I wanted to use Rack to intercept the request and check
the headers and proceed from there. However, when I was playing around with it
in Request Bin, I noticed that Genius actually modifies the URL so that there
is no reference to them anywhere in the headers. This is generally poor
etiquette and forced me to modify my approach.

Thanks for your comment!

~~~
sbierwagen
Click the "reply" link on a comment to reply to that comment.

------
gergles
I guess Genius doesn't care about the rampant copyright violation involved
with the "web annotator"? Using genius.it/ creates derived works, and it does
so almost certainly without approval of the copyright owner.

I guess they will argue fair use, but hostile 'annotations' definitely reduce
the value of the work, they reuse the entire work, and they use the work for
commercial gain. I wouldn't consider this a slam dunk.

I actually really dislike this concept of "we're going to wrap your website
and mark it up with other stuff to make it look like you're hosting this
content here". Sure, people should be able to talk wherever they want, but
keep that in a popup, or at worst a frame - don't highlight text to suggest
that the author has done that, and don't load your own elements in their page.

~~~
chatmasta
Thanks for the interesting, non-inflammatory comment. You raise a good point.

The fact that they proxy the content on their servers definitely puts them in
a more vulnerable position than if this were, for example, a strictly client-
side chrome extension that fetched annotation metadata and re-rendered the
page accordingly.

In the purely client-side case, the full article would not pass through their
servers, only bits and pieces of it. It would be easier to argue fair-use if
you're only storing parts of the articles, and comments/highlights, on a
remote server, instead of proxying the entire content.

(What if the article is behind a paywall, for example? Then genius.it
effectively becomes a circumvention proxy.)

------
tzs
I do not understand how genius.it is legal.

Based on what I read about it before I actually saw it in action, I had
guessed that they were showing the original site in a frame served from the
original site with their annotations outside that frame.

(That may or may not be legal. I'm not sure if it has been settled whether or
not displaying someone's page served from their site in a frame served from
your site might be a violation of the public display copyright right).

However, after looking at the genius.it page that was linked in another
comment for part of this very thread, and also looking at the genius.it page
for my own website, that's not the case. They appear to have made a copy of
the base page itself and are serving that themselves. They don't seem to copy
images and stylesheets--those are still being served from the original server.

In the copy of the page they serve, they modify the links contained therein to
be genius.it links. That's making a derivative work.

I don't think Genius could argue successfully that this use is fair use. They
are a commercial site, and they are copying the entire page from the original
site.

~~~
michaelmrose
Wouldn't it be extremely easy for this to happen in the users browser wherein
you have no right nor power and just fetch annotations based on the current
url?

If it doesn't already work that way it would be trivial to do so.

------
simonw
In case you were wondering how it works, this library is a rack middleware
wrapper around this JavaScript:

    
    
          <script>
            var annotated = window.location.href.indexOf("genius.it/") != -1;
            if (annotated) {
              window.location.href = window.location.href.replace("genius.it/", "")
            }
          </script>

~~~
web007
Leftpad all over again.

~~~
runandcode
Hey, OP here.

I originally intended to leverage Rack all the way through by inspecting
headers. However, much to my chagrin, I discovered that Genius does not reveal
its identity in the headers, so I had to resort to JS instead to accomplish my
goal.

------
koolba
I'm no JS expert[1] but this doesn't look correct:

    
    
         # https://github.com/marlabrizel/genius-blocker/blob/master/lib/genius/blocker.rb#L11
         var annotated = window.location.href.indexOf("genius.it/") != -1;
         if (annotated) {
           window.location.href = window.location.href.replace("genius.it/", "")
         }
    

Wouldn't this match any instance of "genius.it" throughout the URL, not just
at the beginning?

For example it'd match "[https://example.com/blog/how-to-block-
genius.it"](https://example.com/blog/how-to-block-genius.it") and redirect the
user to a (probably) non-existent link with that string removed.

[1]: _I just play one on HN._

~~~
runandcode
Hey koolba, OP here.

Thanks for the code review - it's always good to see suggestions on how to
improve things. If you have ideas on how to make the code better, please feel
free to submit a pull request. Thanks for sharing your feedback!

------
tkone
I wrote some javascript you can stick on your page that blocks all attempts
for genius to inject shit into your DOM.

[https://github.com/toddself/genius-
blocker](https://github.com/toddself/genius-blocker)

~~~
runandcode
Hey tkone,

Thanks for sharing. The gem works in a similar way, with a small JS script.

------
j_s
Going a bit meta here: Is there a standard library to use for monitoring 3rd-
party interactions users bring to a website?

Typically this would mean browser add-ons and extensions, but I wouldn't be
surprised to discover other things (like headers injected by cellular
companies, or who knows what from malware infections).

Such a tool would be useful when troubleshooting various 'works on my machine'
scenarios.

------
colinbartlett
This is pretty clever, thanks to the author for releasing it.

Personally, I might rather just add the script tag to my site's layout rather
than introduce another gem dependency. But maybe if you have lots of sites to
maintain, this could be preferred?

------
donohoe
See also this one by the talented Vijith Assar:

[https://github.com/vijithassar/genius-
defender](https://github.com/vijithassar/genius-defender)

Unlike the others (which prevent hosting on genius.it) this one actually
prevents annotations via plugin etc by injecting invisible characters at
random. Its a WP plugin but the method could be adapted.

Unsure if there are SEO/other implications.

More info: [http://www.vijithassar.com/2641/how-to-block-genius-
annotati...](http://www.vijithassar.com/2641/how-to-block-genius-annotations)

------
gkop
Folks blocking, curious your motivations? (I can think of a few but am curious
about the specific issues with Genius vs. the platonic ideal of a universal
web annotation layer)

~~~
anoonmoose
I'd have to imagine it's the same as the list of motivations one would provide
for disabling comments, which I've seen happen on plenty of sites.

~~~
chatmasta
You mean like how CNN disables comments so that people are unable to call them
out on their bullshit? So they can post fearmongering articles with little
basis in reality, backed up by quotes from unnamed anonymous "intelligence
sources?" So they can continue to spread misinformation on behalf of the US
government without anyone questioning it?

The mainstream media is a complete poison to society. It needs to be
dismantled and ripped apart. It's a dark, dark villain that needs to be
exposed to the sunlight and shown for the monster that it is.

That would be easier if comments were allowed on "publications" like CNN, but
unfortunately they're disabled.

Personally, I am fully in support of federated "overlay" commenting systems
like news genius, because they rightfully remove control/moderation over the
comments from the publisher, and place it into the hands of a "trusted 3rd
party" (genius).

------
dcole2929
Didn't even know this was a thing but after taking a gander at the first
example of this on the News Genius
([http://news.genius.com/](http://news.genius.com/)) website I'm not surprised
people want to get rid of it. I read the 2nd article, a buzz feed production
about Trump's campaign adviser, and honestly I'm highly disappointed at the
quality of the annotations. Even more so when I found out that the person
doing said annotations is the Managing News Editor at Genius. Buzz feed is by
no means a bastion of journalistic integrity but the superficial comments this
editor left are a joke. If she was actually the editor for this article it
might make sense to complain about wording choices but as I understand it
Genius Annotations are meant to explain and expand upon things in the article.
Here, the person Genius felt most qualified to head this whole effort, uses
annotations like a permanent twitter stream of her personal opinion of the
article. She complains about not expanding upon allegations but the article
does. Not always but in a lot of cases they can't. No one is going on the
record against a man working for the likely republican nominee. They can't
afford to burn bridges because they still need access to Trump. All in all if
that is the quality of annotations created by Genius' Managing New Editor this
is a feature that needs to be taken out back.

------
mchahn
To me a big motivation is to keep control of the content on your page. Also,
isn't it a copyright violation?

~~~
Denzel
IANAL, but I absolutely believe there's the possibility to raise a copyright
violation suit. There have been cases brought against Google in the past for
caching webpages. This is why google/bing web crawlers abide by robots.txt.

NewsGenius needs to at least 1) identify their crawler, and 2) provide a way
to opt-out. Otherwise, it doesn't look good for them. They're not being a very
good citizen of the Web.

------
pbarnes_1
If Genius were actually acting in good faith, they'd allow some sort of
'robots.txt' like functionality, which would solve this whole thing in a nice
way.

But that's unlikely.

~~~
siegecraft
It would be nice if they made it even easier for users on hosted services who
can't necessarily change robots.txt so you could opt out on a per-page basis.
But I don't think anyone expects Genius to act in good faith.

