• All Purchases made this month instantly go into the draw to win a USD $ 100.00 credit to your HoP account.
 

Richee
BRONZE Member since Jan 2002

HOP librarian
Location: Prague

Total posts: 1841
Posted:Offline, shell scrypt recoder for old HOP threads.

--------------------------------------------------

Code:
#!/bin/sh
#HOP Old Thread Recoder
#

#URL
sed -i s/\<a\ href=\"/[url=/ $1
sed -i s/\<a\ href=\"/[url=/ $1
sed -i s/\<\\/a\>/[\\/url]/ $1
sed -i s/\<\\/a\>/[\\/url]/ $1
sed -i s/\"\ target=\"_blank\"\ rel=\"nofollow\"\>/]/ $1
sed -i s/\"\ target=\"_blank\"\ rel=\"nofollow\"\>/]/ $1

#QUOTE
sed -i s/\<\\/font\>\<blockquote\>\<span\ class=\"small\"\>\&nbsp\;Written\ by:\<\\/span\ class=\"endsmall\"\>/[quote]/ $1
sed -i s/\<\\/font\>\<blockquote\>\<span\ class=\"small\"\>\&nbsp\;Written\ by:\<\\/span\ class=\"endsmall\"\>/[quote]/ $1
sed -i s/\<\\/blockquote\>\<font\ class=\"post\"\>/[\\/quote]/ $1
sed -i s/\<\\/blockquote\>\<font\ class=\"post\"\>/[\\/quote]/ $1

#IMG
sed -i s/\<img\ src=\"/[img]/ $1
sed -i s/\<img\ src=\"/[img]/ $1
sed -i s/\"\>/[\\/img]/ $1
sed -i s/\"\>/[\\/img]/ $1

#REWRITE
sed -i s/\?Cat=0\&amp\;Board=UBB3\&amp\;Number=/\\/Cat\\/0\\/Number\\// $1
sed -i s/\?Cat=0\&amp\;Board=UBB3\&amp\;Number=/\\/Cat\\/0\\/Number\\// $1

exit 0


--------------------------------

The code is too fast so it need to be done twice,
because sed like to forget something..

until tis get fixed,

:R

hug


POI THEO(R)IST

Delete Topic

pineapple pete
SILVER Member since Sep 2004

pineapple pete

water based
Location: melbourne

Total posts: 5125
Posted:uhm, is there are more plain-language description available?

thanks again richee

hug


"you know there are no trophys for doing silly things in real life yeah pete?" said ant "you wont get a 'listened to ride of the valkyries all the way to vietnam' trophy"

*proud owner of the very cute fire_spinning_angel, birgit and neon shaolin*

Delete

aston
SILVER Member since Dec 2007

aston

Unofficial Chairperson of Squirrel Defense League
Location: South Africa

Total posts: 4061
Posted:If I am understanding it correctly:

If you stumble across an old link, you can use the Perl code above to convert it into the new format.

For Windows users you probably need something like CygWin. Logging in via something like PuTTY to a *nix box may allow you to do the same.

Most Linux distros allow you to open a terminal which will allow you to do this quite easily.

I do not know anything about Macs.

Exactly how to use it, I am not sure either though, sorry.


'We're all mad here. I'm mad, you're mad." [said the Cat.]
"How do you know I'm mad?" said Alice.
"You must be," said the Cat, "Or you wouldn't have come here."
- Lewis Carroll, Alice's Adventures In Wonderland

Delete

pineapple pete
SILVER Member since Sep 2004

pineapple pete

water based
Location: melbourne

Total posts: 5125
Posted:ah yes, i see..

i also understand why i didnt understand.. and now know why im continuing to not understand..

maybe i should learn perl smile

hug


"you know there are no trophys for doing silly things in real life yeah pete?" said ant "you wont get a 'listened to ride of the valkyries all the way to vietnam' trophy"

*proud owner of the very cute fire_spinning_angel, birgit and neon shaolin*

Delete

ElectricBlue
SILVER Member since Feb 2002

ElectricBlue

Now with extra strawberries
Location: Canberra

Total posts: 810
Posted:Ooo i like it!!
THough i haven't run across many old links.


I {Heart} hand me downs and spinning in the snow.<br /><br />

Delete

Richee
BRONZE Member since Jan 2002

HOP librarian
Location: Prague

Total posts: 1841
Posted:When editing a thread with an old index (before site upgrade).

The old UBB code change into HTML hard code
instead of new UBB code.

This scrypt has as an input a file that include source of that
code and perform an 'inline substitution' into new UBB code
and repair one URL form change too.

--------------------------

This will be fixed on server side, erhmm..

nothing,

:R

hug

EDITED_BY: Richee (1228325407)


POI THEO(R)IST

Delete


Similar Topics

Using the keywords [old recoder] we found the following similar topics.
1. Forums > Old people - why do they smell? [64 replies]
2. Forums > OLD HOP HEADS V.S NEW HOP HEADS [132 replies]
3. Forums > OLD THREAD about Woodford [77 replies]
4. Forums > HOP Old Thread Recoder [5 replies]
5. Forums > The Kids These Days! [43 replies]

     Show more..