link text question

edited January 2008 in Stylish
I'm making a "browse torrents" style. I'm going to have to convert it to greasemonkey later - I know. But I just want to take one more step with stylish before I face my bogeyman: javascript.

I've figured out how to hide links to movies I've seen or don't want to see

a:link[href*='Star_Wars'],
a:link[href*='Star.Wars'],
a:link[href*='Star-Wars'],
a:link[href*='Star+Wars'],

Of course it's an ugly solution that's better solved with javascript: regular expressions etc.

However - I did use my very large and ugly script today at The Pirate Bay and it helped me find six films. That would have been impossible without my style. I scanned 20 pages pretty quickly.

I know how to hide (or change) links by using

href=
title=
name=
class=

but I want to learn how to hide (or change) links by using the link text itself. I can't figure out how - and googling has gotten me nowhere.

These don't do a thing:

a[text*='Star Wars'],
a:link[text*='Star Wars'],
a[link-text*='Star Wars'],

Comments

  • the url uses href and the name uses title
    @namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain("thepiratebay.org"){ .detLink[title*="Star_Wars"], .detLink[title*="star_wars"], .detLink[title*="STAR WARS"], .detLink[title*="Star Wars"], .detLink[title*="Star.Wars"], .detLink[title*="Star wars"], .detLink[title*="star Wars"], .detLink[title*="star wars"]{color:red!important} }
  • ekbworldwide:

    Since you already plan to move to Greasemonkey, you should take notice that this is much easier (on you and your RAM) than this.

    @namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain("thepiratebay.org"){ .detLink.AlreadySeen{color:red!important} }

    With the Greasemonkey code, you'll need to craft an event (onClick?) for those torrents, which then uses:

    document.window.TorrentTag.InsertAttribute('class','AlreadySeen');

    ... I think.

    Then, your CSS will apply, and behave, and not delay page loads for seconds, chugging away on Stylish CSS.
  • ChoGGi, whatrevolution - thank you.

    My first modest goal was to get the thing to work as a style at The Pirate Bay. And I did. Then I wanted it to work at a bunch of torrent sites. I surprised myself - based on that Star Wars example

    I've been able to get the style to work at a few places:

    btjunkie.org
    http://btjunkie.org/browse?c=6&o=72

    fenopy.com: Movie - Adventure
    http://fenopy.com/browse/3/32/index.html&order=4&start=0

    monova.org: Movies - Action
    http://www.monova.org/subcat.php?id=1

    thepiratebay.org
    http://thepiratebay.org/browse/201

    torrentportal.com
    http://www.torrentportal.com/torrents.php?cat=2&count=115325&page=0

    Some sites (fenopy, monova, torrentz) don't seem to allow browsing all movies - they force you into categories. If anybody can figure out how to browse all movies - please let me know.

    The style fails at sites like torrentz.com since links are like this:

    <a title="/c57952c70ab0e8eec2492421ed0a9160edaaab35" href="/c57952c70ab0e8eec2492421ed0a9160edaaab35">The Departed KLAXXON</a>

    ___________________________________________question 1_

    Can a style block links like that? Using link text? Another way?

    HTML element - Wikipedia
    http://en.wikipedia.org/wiki/HTML_element#Links_and_anchors

    Also (planning for the future) what the heck does javascript call link text?

    ___________________________________________question 2_

    isohunt.com weirdness

    I'm working an silly simple style - call it "lime green links". I'm using it to find all the right links. Right now it changes all the links on a page to lime green - eventually (hopefully?) it'll change just the torrent links to lime green.

    I'll do the same thing when I finally struggle with javascript.

    It works at all the sites except

    isohunt.com

    There, only the links outside of the table are lime green. I have no idea why.

    @namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(btjunkie.org), domain(fenopy.com), domain(fulldls.com), domain(isohunt.com), domain(mininova.org), domain(monova.org), domain(mybittorrent.com), domain(newtorrents.info), domain(seedpeer.com), domain(thepiratebay.org), domain(torrentportal.com), domain(torrentz.com) { a:link { color: limegreen !important } a:visited { color: purple !important } a:hover, a:active { color: red !important } }
  • I'm working an silly simple style - call it "lime green links". I'm using it to find all the right links. Right now it changes all the links on a page to lime green - eventually (hopefully?) it'll change just the torrent links to lime green.
    not sure if you want the listings or the actual torrent links to be green so i did both
    btw you should always leave at least one url/domain on the @-moz-document line if the space is removed then you'll get errors
    @namespace url(http://www.w3.org/1999/xhtml); @-moz-document domain(btjunkie.org), domain(fenopy.com), domain(fulldls.com), domain(isohunt.com), domain(mininova.org), domain(monova.org), domain(mybittorrent.com), domain(newtorrents.info), domain(seedpeer.com), domain(thepiratebay.org), domain(torrentportal.com), domain(torrentz.com) { /*fenopy make download torrent link image into link */ a[href="download.torrent"]:after{content:"Download"!important;color:limegreen!important} a[href="download.torrent"]>img{display:none!important} /*torrentz*/ .results>dl>dt>a, /*mybittorrent*/ a[href^="/info/"], .download>a[href^="/dl/"], /*seedpeer*/ .dlbox>#reportdiv+a, /*newtorrents*/ a[href^="/down.php?id="], /*fulldls*/ a[href^="/torrent-"], a[href^="download-"], /*pirates bay*/ a[href^="/tor/"], a[href^="http://torrents.thepiratebay.org/"], /*monova*/ a[href*="monova.org/details/"], a[href*="monova.org/download/"], /*torrentportal*/ a[href^="/details/"], a[href^="/download/"], /*fenopy*/ a[href*="fenopy.com/torrent/"], /*btjunkie*/ a[href^="/torrent/"], a[href$="/download.torrent"], /*isohunt*/ body>a[href^="/download/"]{color:limegreen!important} a:visited{color:purple!important } a:hover,a:active{color:red!important} }
  • Great!
    I have lots to (try to) figure out.

    btw you should always leave at least one url/domain on the @-moz-document line if the space is removed then you'll get errors

    That's good to know. My script is acting a bit buggy at fenopy...
Sign In or Register to comment.