Skip to content

Obviate.io

To anticipate and prevent

  • Home
  • About Us
  • History
  • Privacy Policy
  • Toggle search form

Quick Perl Script

Posted on 2005-02-13 By Jon No Comments on Quick Perl Script

So I wanted a way to quickly add links to my homepage(/website). Its 3 easy steps

1 — “links.html” — This file either needs to be chmod 777 or chown www-data (or what ever you apache user is).

2 — Bookmark Java. I created a new bookmark in firefox with the following as location: (as put it in my toolbar for ease of use).

javascript:win=open('http://www.mypage.com/bookmark.cgi?'+document.URL, '_new','width=600,height=100');history.go(-0);

3 — “bookmark.cgi” — 4 massive lines!

#!/usr/bin/perl<br />
open(URLOUT, ">> links.html");<br />
print URLOUT "<li><a href=\"$ENV{'QUERY_STRING'}\">$ENV{'QUERY_STRING'}</a></li>\n";<br />
close(URLOUT);<br />
print "Content-Type: text/html\n\n" . "<html>BOOKMARKED:<br>\n " . $ENV{'QUERY_STRING'};<br />

4 (optional) — As you can see from above, it puts the data in

  • tags for ease of use by me. I have my index.shtml using SSI’s to pull links.html

    `

    `

    Note/Warning! First the note, you can modify the print statement to do what ever you want (no need to stick to my example). WARNING!!! There is no security! No security at all. So anyone can add links if they knew the page name. So please, security through obscurity!

  • Linux

    Post navigation

    Previous Post: iTunes and its randomization
    Next Post: Save the Archives!

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    February 2005
    S M T W T F S
     12345
    6789101112
    13141516171819
    20212223242526
    2728  
    « Jan   Mar »

    Copyright © 2022 Obviate.io

    Powered by PressBook Premium theme