Author Topic: Change Flash & Sounds to link  (Read 3610 times)

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Change Flash & Sounds to link
« on: January 15, 2002, 07:37:01 PM »
The following filters will change the most common "noisemakers" on pages to links (Wave files, midis, mp3s and Flash).

## Stop plugins
[Blocklists]
List.AllowFlash = "..ListsAllowFlash.txt"

[Patterns]
Name = "Convert Flash animations to links"
Active = TRUE
URL = "^$LST(AllowFlash)"
Bounds = "<objects*</object>|<embeds*>"
Limit = 1024
Match = "<1s*(shockwave|macromedia|flash|swf)*&"
        "(*(src=$AV(2)|"
        "*<param name=$AV(movie) value=$AV(2) >)*)"
Replace = "<a href="2"><span class=prox kill=1 detail=Flash> 2</span></a>"

Name = "EMBED & type MID: Convert to Link"
Active = TRUE
Bounds = "<(embed|bgsound)s*>"
Limit = 256
Match = "*src=("*'|w)1*&*(.mid|midi)2"
Replace = "<span class=prox detail=MID><a href=1 >[2]</a></span>"

Name = "EMBED & type MP3: Convert to Link"
Active = TRUE
Bounds = "<(embed|bgsound)s*>"
Limit = 1024
Match = "*src=("*'|w)1*&*(*.mp3)2"
Replace = "<span class=prox detail=MP3><a href=1 >[2]</a></span>"

Name = "EMBED & type WAV: Convert to Link"
Active = TRUE
Bounds = "<(embed|bgsound)s*>"
Limit = 1024
Match = "*src=("*'|w)1*&*(*.wav)2"
Replace = "<span class=prox detail=WAV><a href=1 >[2]</a></span>"

In order to allow Flash on certain pages, create a file called AllowFlash.txt and place it in your /Lists folder.

My file starts like this:
# This list contains pages where I want to see Flash

(www.|)newgrounds.com/
(www.|)ashfieldonline.com/
(www.|)myst3.com/


 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Change Flash & Sounds to link
« Reply #1 on: April 25, 2002, 02:55:33 AM »
Newer versions of these filters:

[Patterns]
Name = "Convert Flash animations to links"
Active = TRUE
URL = "$TYPE(htm) & (^$LST(AllowFlash))"
Bounds = "$NEST(<object,</object>)|<embeds*>"
Limit = 1024
Match = "<1s*(shockwave|macromedia|flash|swf)*&"
        "(*(src=$AV(2)|"
        "*<param name=$AV(movie) value=$AV(2) >)*)"
Replace = "<a href="2" class="flash" class="proxlink"> 2</a>"

Name = "Embed or BGsound to Link"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<(embed|bgsound)s*>"
Limit = 256
Match = "*src=("*'|w)1*&*.(mid|midi|wav|mp3)2"
Replace = "<a class="sound" class="proxlink" href=1>[2]</a>"

The filters now make use of the link styling filters posted in the COSMETIC forum, so you can apply styles to them.

[Edit: 'bounds' improved, and URL = "$TYPE(htm)" added]

Edited by - Jor on 18 Jun 2002  15:45:44
 

lnminente

  • Jr. Member
  • **
  • Posts: 73
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
Change Flash & Sounds to link
« Reply #2 on: August 26, 2002, 03:34:01 PM »
Hi Jor. Thanks for your filters.

I like filter that:

<OBJECT ID="MediaPlayer1" width=300 height=41
   classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
   codebase=
   "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"
        standby="Loading Microsoft? Windows? Media Player components..."
        type="application/x-oleobject" align="absmiddle">
              <PARAM NAME="FileName" VALUE="midis/varios/zip1.mid">
              <PARAM NAME="AutoStart" VALUE="true">
              <EMBED type="application/x-mplayer2"
   pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
   SRC="../midis/varios/zip1.mid"
   width=300
   height=41
   AutoStart=true align="absmiddle" filename="midis/varios/zip1.mid" volumen="+30">
              </EMBED>
</OBJECT>

So i modified your filter:
Name = "Convert bg or embed sounds to links"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "$NEST(<object,</object>)|<(embed|bgsound)s*>"
Limit = 1024
Match = "*ssrc=("*'|w)1*&*.(mid|midi|mp3|wav|wmx|wma)2"
Replace = "<a class="sound" class="proxlink" href=1>[2 - 1]</a>"

Regards.

Updated, thanks Jor

Edited by - lnminente on 26 Aug 2002  19:35:45
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Change Flash & Sounds to link
« Reply #3 on: August 26, 2002, 05:15:22 PM »
Good change

I had actually been using '$NEST(<object,</object>)|<(embed|bgsound)s*>' as my bounds for some time, forgot to update this message.

Oh, and add these two extensions to the filter as well: wmx, wma (Windoze Media)