Post Edit Home Help

Key Pages

Home |
Categories |
Markup |
Statistics |
Protected pages

Changes [Sep 25, 2007]

Categories
WubWiki
Low hanging fruit
Wild ideas
Not-so-wild ideas
Download wiki datab...
Revision history
   More Changes...
Changes [Sep 25, 2007]: Categories, WubWiki, Low hanging fruit, Wild ideas, ... MORE

Find Pages

Various pages contain references to mini.net/tcl - the original wiki URL and which still points to the server that used to host the wiki.

Mini.net is going to be decommissioned in the near future, so these will need to be identified and changed.

Also, many images used in wiki pages still live on mini.net - so a new home will have to be found for them


jdc I ran this script on a local copy of the wiki database to get a list of mini.net references:

package require Mk4tcl

mk::file open db /tmp/wiki/data/wikit.tkd
mk::view layout db.pages
foreach pn [mk::select db.pages -glob page "*mini.net*"] {
    set nm [mk::get db.pages!$pn name]
    set pg [mk::get db.pages!$pn page]
    foreach i [split $pg] {
	if { [string match "*mini.net*" $i] } {
	    if { [info exists ml($i)] } {
		lappend ml($i) $pn
	    } else {
		set ml($i) [list $pn]
	    }
	    if { [info exists pl($pn)] } {
		lappend pl($pn) $i
	    } else {
		set pl($pn) [list $i]
	    }
	}
    }
}

mk::file close db

set f [open mini_net_img_page.dat w]
foreach i [lsort -dictionary [array names ml]] {
	puts $f "$i : $ml($i)"
}
close $f

set f [open mini_net_page_img.dat w]
foreach p [lsort -dictionary [array names pl]] {
    set first 1
    foreach i $pl($p) {
	if { $first } { 
	    puts $f "$p:"
	    set first 0
	}
	puts $f "    $i"
    }
}
close $f

exit

This script generates 2 files. mini_net_img_page.dat contains the mini.net links with a list of the pages in which they were found. mini_net_page_img.dat contains the pages with a list of mini.net references.


jdc I downloaded all png/jpg/gif files from mini.net I could find in wikit.tkd (local copy). They are now available from http://tclerswiki.googlepages.com. To access an image, add the image name this url: http://tclerswiki.googlepages.com. mini.net had different subdirectories where images were stored. This is not possible on http://tclerswiki.googlepages.com.


The following script will:

  1. update references to mini.net to references to http://tclerswiki.googlepages.com for pgn/jpg/gif files in the pub, files and sdarchive directories on mini.net.
  2. This script will update links to http://mini.net/tcl/ number to point to http://wiki.tcl.tk/ number:
  3. This script will update all references to http://mini.net/tcl/rss.xml to http://wiki.tcl.tk/rss.xml:

package require Mk4tcl

mk::file open db /tmp/wiki/data/wikit.tkd

while { 1 } { 

    set cnt 0
    
    foreach pn [mk::select db.pages -glob page "*mini.net*"] {
	set pg [mk::get db.pages!$pn page]
	set rpg {}
	foreach i [split $pg "\n"] {
	    if { [regexp {\[http://mini.net/(files|sdarchive|pub)/([^.\]]+\.(png|jpg|gif))\]} $i m f1 fnm] } {
		puts "$pn: $i : $fnm"
		incr cnt
		regsub {\[http://mini.net/(files|sdarchive|pub)/([^.\]]+\.(png|jpg|gif))\]} $i "\[http://tclerswiki.googlepages.com/$fnm\]" i
	    }
	    if { [regexp {http://mini.net/tcl/([0123456789]+)} $i m pnr] } {
		puts "$pn: $i : $pnr"
		incr cnt
		regsub {http://mini.net/tcl/[0123456789]+} $i "http://wiki.tcl.tk/$pnr" i
	    }
	    if { [regexp {http://mini.net/tcl/rss.xml} $i m] } {
		puts "$pn: $i"
		incr cnt
		regsub {http://mini.net/tcl/rss.xml} $i "http://wiki.tcl.tk/rss.xml" i
	    }
	    lappend rpg $i
	}
	set pg [mk::set db.pages!$pn page [join $rpg "\n"]]    
    }
    
    puts $cnt
    
    if { $cnt == 0 } { 
	break
    }
}

mk::file commit db
mk::file close db

exit


jdc After running these scripts, searching for mini.net references results in the list found here. Can any of those be done automatically?

mjanssen mentioned the following possible convertions in the Tcler's chat:

regsub -all {^http://mini.net/tcl/(.*)\*$} http://mini.net/tcl/see* {http://wiki.tcl.tk/_search?S=\1*}
regsub -all {http://mini.net/tcl/(\S+)\*} {dsakjhd adkh http://mini.net/tcl/see* daskhdasjhd} {http://wiki.tcl.tk/_search?S=\1*}
http://mini.net/sdarchive/ no need to change AFAIKS
http://mini.net/tcl/nstcl -> http://wiki.tcl.tk/nstcl

Changing an url to contain _search will break WubWiki / wikit compatibility because _search is not recognised by wikit. Any opinions?


jdc One possible problem with googlepages is the unknow download limit. When hitting this limit, images will no longer be available for some time.


Posted at May 10/2007 06:02AM by lvirden:
jdc, what is a .dat file?


Posted at May 10/2007 06:13AM by jdc:
lvirden, it's a plain text file with a wrong extention. sorry for the confusion .dat/.txt


Posted at Jun 28/2007 04:39AM by lvirden:
So, I've been working away at changing these by hand. I've managed to whittle the list down to 82 remaining pages with mini.net references. Some of these I'm going to avoid in fear that I might mangle special characters. I don't know for certain whether IE/Firefox on Windows, or lynx on Solaris, is damaging unicode or not. I do know that lynx is messing with lines longer than 1024, as well as with white space for some reason. Sigh.


Posted at Jun 28/2007 04:40AM by lvirden:
Actually, the http://mini.net/sdarchive/ references should change to http://www.tcl.tk/starkits/ .
Edit this Page - Attach File - Add Image - References - Print
Page last modified by lvirden Thu Jun 28/2007 04:40
You must signin to post comments.
Site Home > Tclers Wiki Forum > mini.net references