egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ramdom quote from fmylife.com
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
[Reaper]
Voice


Joined: 20 Jun 2009
Posts: 3
Location: New York

PostPosted: Sat Jun 20, 2009 8:55 pm    Post subject: !fml error Reply with quote

i recently downloaded the fmylife-quote.tcl script to my eggdrop but when i do the !fml i get this "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"><head><meta name="title" content="FML: Your random funny stories" /><meta name="description" content="Share your random unfortunate moments and funny love stories on Fmylife" /><meta name="medium" content="blog" /><link rel="shortcut
[8:46:11pm] <MaNiAC> --| http://www.fmylife.com/health/1962325
"

can anyone tell me what i did wrong?
Back to top
View user's profile Send private message Visit poster's website
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Sun Jun 21, 2009 2:57 am    Post subject: Re: !fml error Reply with quote

[Reaper] wrote:
i recently downloaded the fmylife-quote.tcl script to my eggdrop but when i do the !fml i get this "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"><head><meta name="title" content="FML: Your random funny stories" /><meta name="description" content="Share your random unfortunate moments and funny love stories on Fmylife" /><meta name="medium" content="blog" /><link rel="shortcut
[8:46:11pm] <MaNiAC> --| http://www.fmylife.com/health/1962325
"

can anyone tell me what i did wrong?


You need v0.3, it has updated code for the new layout. Check the second page the code is there.
_________________
I see j00!
Back to top
View user's profile Send private message
[Reaper]
Voice


Joined: 20 Jun 2009
Posts: 3
Location: New York

PostPosted: Wed Jun 24, 2009 8:13 pm    Post subject: Reply with quote

ok thanks Smile
Back to top
View user's profile Send private message Visit poster's website
[Reaper]
Voice


Joined: 20 Jun 2009
Posts: 3
Location: New York

PostPosted: Wed Jun 24, 2009 8:27 pm    Post subject: Reply with quote

Is their a code that doesn't have "<&MaNiAC> I agree, your life is f***ed (10126) - you deserved that one (652). Added On 01/27/2009 at 12:44pm by Anizzaf.
[8:23:56pm] <&MaNiAC> --| http://www.fmylife.com/miscellaneous/2835"
Back to top
View user's profile Send private message Visit poster's website
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Wed Jun 24, 2009 8:35 pm    Post subject: Reply with quote

Sure take that line out of the code, which one it is I don't know. Good luck.
_________________
I see j00!
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Thu Jun 25, 2009 12:20 am    Post subject: Reply with quote

[Reaper] wrote:
Is their a code that doesn't have "<&MaNiAC> I agree, your life is f***ed (10126) - you deserved that one (652). Added On 01/27/2009 at 12:44pm by Anizzaf.
[8:23:56pm] <&MaNiAC> --| http://www.fmylife.com/miscellaneous/2835"

You need to comment that line:
Code:
putquick "PRIVMSG $fm_chan :\00314I agree, your life is f***ed \00303$fm_fckd \00314- you deserved that one \00303$fm_dsrv\00314. Added \00303$fm_date \00314by $fm_name\00303."

_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cg
Voice


Joined: 30 Jun 2009
Posts: 8

PostPosted: Tue Jun 30, 2009 7:56 pm    Post subject: Reply with quote

Hi there,

I'm currently using v3 of this script as per page 2, however it looks like fmylife have updated code again and the regex's aren't picking it up, as my bot doesn't return anything when initiating an !fml request in channel.

Is anyone else seeing this same issue? (i've tried rehashing after putting the script in again too).

Thanks!
Back to top
View user's profile Send private message
wac
Halfop


Joined: 10 Dec 2006
Posts: 80
Location: in my cardboard box

PostPosted: Thu Jul 02, 2009 12:22 pm    Post subject: Reply with quote

cg wrote:
Hi there,

I'm currently using v3 of this script as per page 2, however it looks like fmylife have updated code again and the regex's aren't picking it up, as my bot doesn't return anything when initiating an !fml request in channel.

Is anyone else seeing this same issue? (i've tried rehashing after putting the script in again too).

Thanks!


works fine, you sure you got your channels setup properly?
_________________
I see j00!
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Fri Jul 03, 2009 10:02 am    Post subject: Reply with quote

cg wrote:
Hi there,

I'm currently using v3 of this script as per page 2, however it looks like fmylife have updated code again and the regex's aren't picking it up, as my bot doesn't return anything when initiating an !fml request in channel.

Is anyone else seeing this same issue? (i've tried rehashing after putting the script in again too).

Thanks!

Use !fmylife instead of !fml.
_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mind0rz
Voice


Joined: 16 Jul 2009
Posts: 2

PostPosted: Thu Jul 16, 2009 2:05 pm    Post subject: Reply with quote

i used the new code on page 2, and im getting this output

[11:06am] <@EvilHom3r> !fmylife
[11:06am]« Dem0n » I agree, your life is f***ed <div class="post"><p>Today, I was running to my car, slipped, and slammed my head on the car door.</a> I started driving to the hospital because it was bleeding profusely and I was dizzy, I called my mom to tell her what had happened.</a> She said I was grounded for &quot;goofing off&quot; and that she was &quot;sick of my [censored]&quot;.</a> FML</a></p><div class="date"><div class="left_part"><a href="/miscellaneous/483847" id="
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Thu Jul 16, 2009 3:29 pm    Post subject: Reply with quote

I`ve rewright the code and add country and city to quote info.
You can download it here: http://www.egghelp.ru/file.php?id=460
Or I can post whole code if you can`t download it.
_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mind0rz
Voice


Joined: 16 Jul 2009
Posts: 2

PostPosted: Thu Jul 16, 2009 9:38 pm    Post subject: Reply with quote

username wrote:
I`ve rewright the code and add country and city to quote info.
You can download it here: http://www.egghelp.ru/file.php?id=460
Or I can post whole code if you can`t download it.


thanks, that did the trick
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Fri Jul 17, 2009 3:27 pm    Post subject: Reply with quote

My site currently down, this is the script:
Code:
# Author: tomekk
# e-mail:  tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.3.1
#
# 16.07.09 - changed parsing code and added country and city to quote info.
#
# New html tag by username@forum.egghelp.org
# Wordwrap proc from this post by user http://forum.egghelp.org/viewtopic.php?p=81741#81741
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html

# channels for !fmylife
set fmylife_channels {#egghelp #erotic}

# time between use !fmylife (seconds)
set fmylife_reuse_time 20

# auto query
# 0 - off, 1 - on
set fmylife_auto_query 0

# set auto query interval (minutes)
set fmylife_auto_interval 10

###########################################################
bind pub - !fmylife fm_main_proc

package require http

proc get_fmylife { } {
   set f_http_uagent "Opera/9.61 (Windows i686; U; en) Presto/2.1.1"
   set f_http_token [http::config -useragent $f_http_uagent]
   if {[catch {set f_http_token [::http::geturl "http://www.fmylife.com/random" -timeout 15000]}]} {
      return "error"
   } {
      return [http::data $f_http_token]
   }
}

set fmylife_reuse 1

proc fmylife_timer { } {
   global fmylife_auto_interval
   fm_auto_proc

   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

proc fm_auto_proc { } {
   global fmylife_channels

   set fm_quote ""
        set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putlog "auto-quote-fmylife: problem with connection"
      return
   }

   foreach fm_each_chan [split $fmylife_channels] {
      if {$fm_each_chan != ""} {
         set fm_each_chan [string trim $fm_each_chan]

         if {[botonchan $fm_each_chan]} {
             fmylife_print $fm_quote $fm_each_chan
         }
      }
   }
}

proc fm_main_proc { nick uhost hand chan arg } {
   global fmylife_channels fmylife_reuse fmylife_reuse_time

   if {[expr [clock seconds] - $fmylife_reuse] <= $fmylife_reuse_time} {
      putquick "PRIVMSG $chan :$nick: to fast, sorry"
      return
   }

   if {[lsearch $fmylife_channels $chan] == -1} {
      return
   }

   set fm_quote ""
   set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putquick "PRIVMSG $chan :problem with connection, try again later, sorry"
      return
        }

   fmylife_print $fm_quote $chan
}

proc fmylife_print { fm_data fm_chan } {
   global fmylife_reuse

   set fm_link ""

   regsub -all -nocase "\n" $fm_data "" fm_data
   regsub -all -nocase "\r" $fm_data "" fm_data
   regsub -all -nocase "\t" $fm_data "" fm_data

   # 1st quote
   regsub -nocase {.*<div\s+class=\"clear\"><\/div><\/div>(.+)<div\s+class=\"more\">.*} $fm_data {\1} fm_data

   # 1st link
   regsub -nocase {.*<a\s+href=\"([a-z0-9\/ ]+)\"\s+class="fmllink">.*} $fm_data {\1} fm_link

   # del rest of links from quote
   regsub -all -nocase {<a\s+href=\"[a-z0-9\/ ]+\"\s+class=\"fmllink\">} $fm_data "" fm_data

   # voting result
   regsub -nocase {.*sucks<\/a>\s+(.+)<\/span>\s+-.*} $fm_data {\1} fm_fckd
   regsub -nocase {.*it<\/a>\s+(.+)<\/span>.*} $fm_data {\1} fm_dsrv

   # date and name
   regsub -nocase {.*<p\s+style=\"margin-top\:2px\;\">(.+)\s+-\s+<a\s+class=\"liencat\".*} $fm_data {\1} fm_date
   regsub -nocase {.*<a\s+class=\"liencat\"\s+href="/[a-z0-9\/ ]+\">[a-z0-9\/ ]+<\/a>\s+-\s+by\s+(.*?)\s+-\s+<a\s+href=\"\/country\/.*} $fm_data {\1} fm_name
   regsub -all -nocase {<a href="/gender/woman" class="light">} $fm_name "" fm_name
   regsub -all -nocase {<a href="/gender/man" class="light">} $fm_name "" fm_name
   regsub -all -nocase {</a>} $fm_name "" fm_name

   # country and city
   regsub -nocase {.*<a\s+href=\"\/country\/(.*?)\"\s+class=\"liencat\">.*} $fm_data {\1} fm_coun
   regsub -nocase {.*<a\s+href=\"\/region\/(.*?)"\s+class=\"light\">.*} $fm_data {\1} fm_city

   # fml text
   regsub -nocase {.*<div\s+class=\"post\"><p>(.*?)<div\s+class=\"date\">.*} $fm_data {\1} fm_data

   # the rest of useless tags
   regsub -all -nocase "<\/a>" $fm_data "" fm_data
   regsub -all -nocase "<\/p>" $fm_data "" fm_data
   regsub -all -nocase "<\/div>" $fm_data "" fm_data
   regsub -all -nocase "&quote;" $fm_data "\"" fm_data
   regsub -all -nocase "<div.*>" $fm_data "\"" fm_data
   regsub -all -nocase "&quot" $fm_data "\"" fm_data

   set fm_link "http://www.fmylife.com$fm_link"

   if {[regexp -nocase {http:\/\/www\.fmylife\.com[a-z0-9\/ ]+} $fm_link]} {
      fm_msg $fm_chan \00310$fm_data
      putquick "PRIVMSG $fm_chan :\00314I agree, your life sucks \00303$fm_fckd \00314- you totally deserved it \00303$fm_dsrv\00314. Added \00303$fm_date \00314by \00303$fm_name\00314, \00303$fm_coun \00314(\00303$fm_city\00314)."
      putquick "PRIVMSG $fm_chan :\00304--| \00312\037$fm_link\037\003"
      set fmylife_reuse [clock seconds]
   } {
      putquick "PRIVMSG $fm_chan :some problem with data, try again later, sorry"
   }
}

if {$fmylife_auto_query != 0} {
   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

    proc fm_msg {dest data} {
       set len [expr {512-[string len ":$::botname PRIVMSG $dest :\r\n"]}]
       foreach line [fm_wordwrap $data $len] {
          puthelp "PRIVMSG $dest :$line"
       }
    }

    proc fm_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
    }

putlog "fmylife-quote.tcl ver 0.3.1 by tomekk and username loaded"

_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kold
Voice


Joined: 11 Aug 2009
Posts: 2

PostPosted: Tue Aug 11, 2009 7:26 am    Post subject: Reply with quote

Another sweet sweet day saver
Back to top
View user's profile Send private message
Thanhas
Op


Joined: 02 Sep 2006
Posts: 124
Location: Ottawa, Canada

PostPosted: Sun Oct 18, 2009 8:43 am    Post subject: Reply with quote

i need it auto work but i get this Errer in PL

Tcl error [fm_main_proc]: invalid command name "clock"


tomekk wrote:
Code:
# Author: tomekk
# e-mail:  tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.2
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html

# channels for !fmylife
set fmylife_channels {#channel #channel2}

# time between use !fmylife (seconds)
set fmylife_reuse_time 20

# auto query
# 0 - off, 1 - on
set fmylife_auto_query 0

# set auto query interval (minutes)
set fmylife_auto_interval 30

###########################################################
bind pub - !fmylife fm_main_proc

package require http

proc get_fmylife { } {
   set f_http_uagent "Opera/9.61 (Windows i686; U; en) Presto/2.1.1"
   set f_http_token [http::config -useragent $f_http_uagent]
   if {[catch {set f_http_token [::http::geturl "http://www.fmylife.com/random" -timeout 10000]}]} {
      return "error"
   } {
      return [http::data $f_http_token]
   }
}

set fmylife_reuse 1

proc fmylife_timer { } {
   global fmylife_auto_interval
   fm_auto_proc

   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

proc fm_auto_proc { } {
   global fmylife_channels

   set fm_quote ""
        set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putlog "auto-quote-fmylife: problem with connection"
      return
   }

   foreach fm_each_chan [split $fmylife_channels] {
      if {$fm_each_chan != ""} {
         set fm_each_chan [string trim $fm_each_chan]

         if {[botonchan $fm_each_chan]} {
             fmylife_print $fm_quote $fm_each_chan
         }
      }
   }
}

proc fm_main_proc { nick uhost hand chan arg } {
   global fmylife_channels fmylife_reuse fmylife_reuse_time

   if {[expr [clock seconds] - $fmylife_reuse] <= $fmylife_reuse_time} {
      putquick "PRIVMSG $chan :$nick: to fast, sorry"
      return
   }

   if {[lsearch $fmylife_channels $chan] == -1} {
      return
   }

   set fm_quote ""
   set fm_quote [get_fmylife]

   if {($fm_quote == "error") || ($fm_quote == "")} {
      putquick "PRIVMSG $chan :problem with connection, try again later, sorry"
      return
        }

   fmylife_print $fm_quote $chan
}

proc fmylife_print { fm_data fm_chan } {
   set fm_link ""

   regsub -all -nocase "\n" $fm_data "" fm_data
   regsub -all -nocase "\r" $fm_data "" fm_data
   regsub -all -nocase "\t" $fm_data "" fm_data

   # 1st quote
   regsub -nocase {.*<div\s+class=\"post\"><p>(.+)</p><div\s+class=\"date\"\s+style=\"float:left;\">.*} $fm_data {\1} fm_data

   # 1st link
   regsub -nocase {.*<a\s+href=\"([a-z0-9\/ ]+)\"\s+class=\"fmllink\">.*} $fm_data {\1} fm_link

   # del rest of links from quote
   regsub -all -nocase {<a\s+href=\"[a-z0-9\/ ]+\"\s+class=\"fmllink\">} $fm_data "" fm_data

   # the rest of useless tags
   regsub -all -nocase "<\/a>" $fm_data "" fm_data

   set fm_link "http://www.fmylife.com$fm_link"

   if {[regexp -nocase {http:\/\/www\.fmylife\.com[a-z0-9\/ ]+} $fm_link]} {
      putquick "PRIVMSG $fm_chan :$fm_data"
      putquick "PRIVMSG $fm_chan :--| $fm_link"
      set fmylife_reuse [clock seconds]
   } {
      putquick "PRIVMSG $fm_chan :some problem with data, try again later, sorry"
   }
}

if {$fmylife_auto_query != 0} {
   if {[string match *fmylife_timer* [timers]] != 1} {
      timer $fmylife_auto_interval fmylife_timer
   }
}

putlog "fmylife-quote.tcl ver 0.2 by tomekk loaded"


test it
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 3 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber