Site source
Code: Select all
<div id="content">
<!--<div id="top">
</div>-->
<div id="lc">
<div id="stories">
<div id="s_123" class="story s">
<div class="sc">
<a class="storylink" href="/story/93818/">Thought lying was bad so I chewed up my friends fake id.. That high.</a>
</div>
Code: Select all
if {[regexp -- {<div class="sc".+?><p>(.+?)</p>} $html - fmlq]} {
set fmlq [string trim $fmlq]
Code: Select all
# Fmylife.com Script by Trixar_za
# Based on the Twitter script by Warlord v1.0
# Type in partyline: ".chanset #channel +fml" to enable it.
# Sets the logo
set fml(logo) "\002\[FML\]:\002"
# Sets the user agent
set fml(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"
setudef flag fml
if {[catch {package require http 2.5} e] != 0} {
set fml(noutf8) 1
package require http
}
bind pub - !fml proc:fml
bind pub - .fml proc:fml
# wordwrap code by speechless
proc msg {type dest data} {
set len [expr {500-[string len ":$::botname $type $dest :\r\n"]}]
foreach line [wordwrap $data $len] {
putserv "$type $dest :$line"
}
}
proc wordwrap {data len} {
set out {}
foreach line [split [string trim $data] \n] {
set curr {}
set i 0
foreach word [split [string trim $line]] {
if {[incr i [string len $word]]>$len} {
lappend out [join $curr]
set curr [list $word]
set i [string len $word]
} {
lappend curr $word
}
incr i
}
if {[llength $curr]} {
lappend out [join $curr]
}
}
set out
}
proc proc:fml {nick uhand handle chan input} {
if {[channel get $chan fml]} {
global fml
if {[info exists fml(noutf8)]} {
set http [::http::config -useragent $fml(agent)]
} else {
set http [::http::config -useragent $fml(agent) -urlencoding "utf-8"]
}
catch { set http [::http::geturl "http://www.thathigh.com/random/"]}error
if {![string match -nocase "::http::*" $error]} {
msg "PRIVMSG" $chan "$fml(logo) [string totitle [string map {"\n" " | "} $error]]"
return 0
}
if {![string equal -nocase [::http::status $http] "ok"]} {
msg "PRIVMSG" $chan "$fml(logo) [string totitle [::http::status $http]]"
return 0
}
set html [::http::data $http]
# Clean up :P
regsub -all {\n} $html { } html
regsub -all {\t} $html { } html
regsub -all {<br/>} $html { } html
regsub -all { } $html { } html
regsub -all { } $html { } html
regsub -all { } $html { } html
regsub -all { } $html { } html
regsub -all {<a.+?>} $html {} html
regsub -all {</a>} $html {} html
regsub -all {<strong.+?>} $html {} html
regsub -all {</strong>} $html {} html
regsub -all {—} $html {-} html
regsub -all {>} $html {>} html
regsub -all {<} $html {<} html
regsub -all {&} $html {\&} html
regsub -all {×} $html {*} html
regsub -all {(?:\x91|\x92|’|‘|')} $html {'} html
regsub -all {(?:\x93|\x94|“|”|")} $html {"} html
regsub -all {×} $html {x} html
regsub -all {(?:<!\[CDATA\[)} $html {} html
if {[regexp -- {<div class="sc".+?><p>(.+?)</p>} $html - fmlq]} {
set fmlq [string trim $fmlq]
}
if {[info exists fmlq]} {
msg "PRIVMSG" $chan "$fml(logo) $fmlq"
} else {
msg "PRIVMSG" $chan "$fml(logo) Error: Couldn't get a FML quote!"
}
}
}
putlog "Fmylife.com Script by Trixar_za Loaded"
Thanks