i need a little help with this file handling stuff
i'm working on a url catcher script, which catches every said urls on the channel, and makes them shown on a webpage
there's one script like this out there which uses mysqltcl and stores the data into a mysql database
what i am doing is really simple
catches all said urls with *http* and puts them in index.html
my problem that the bot puts every url after the latest one
so if there is a link on the page, the second one goes after
what i actually want is to put a pre defined line into the html
for example <---post here--->
and to make the bot put every post after this line and before the old posts
so every new post will be on the first place
Code: Select all
proc catch_url_pubm {nick host hand chan arg} {
if {[regexp -nocase {(http://[^\s]+)} $arg -> url]} {
if {![catch {open /home/zerodtk/public_html/log/index.php "a+"} af]} {
set type "unknown"
if {![catch {::http::geturl $url} http]} {
if {[regexp -nocase {content-type image|content-type .?image} [::http::meta $http]]} {
set type "image"
puts $af "$nick added a new image $url"
close $af
} else
etc etc
i think an IF command would do the job, but i can't get it work
let me know if you know any solution for this
thanks