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 

XE.com currency convertor script v0.02b
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jan 16, 2010 9:05 pm    Post subject: Reply with quote

shahrul wrote:
Hi,

I got this problem after changing the code.

Code:
Tcl error [xepub]: syntax error in expression "[regexp {>Live rates at (.*?)</span>} $html match xetime] \ ...": extra tokens at end of expression

This was caused by me trying to split the code for easy viewing on the forum. I corrected that mistake in the code given 2 post above.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Thu Jan 21, 2010 11:13 pm    Post subject: Reply with quote

hi speechles,

the code still error.

Code:
Tcl error [xepub]: bad switch "--nocase": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --


can u fix again and upload the new file?
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Fri Jan 22, 2010 6:58 am    Post subject: Reply with quote

shahrul wrote:
hi speechles,

the code still error.

Code:
Tcl error [xepub]: bad switch "--nocase": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --


can u fix again and upload the new file?


Wow.. Third time is the charm I guess. Seems not only did I screw up splitting the line for easy forum viewing I also added an extra hypen to --nocase.. This is because webby requires double hypens and since I used it as an example this carried over into the static regular expression created. Proof I'm human, we make mistakes. The below _should_ fix all the prior problems and actually work this time. Wink

Change this part:
Code:
   if {[regexp {>Live rates at (.*?)</span>} $html match xetime] \
   && [regexp {<td width="45%" align="right" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match fromamount] \
   && [regexp {<td width="45%" align="left" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match toamount]} {
      regsub -all {<!.*?>} $fromamount {} fromamount
      regsub -all {<!.*?>} $toamount {} toamount
      puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
   } else {
      puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
   }


To this:
Code:
   if {[regexp {>Live rates at (.*?)</span>} $html match xetime] && [regexp -nocase {<title>.*?rate\:\s+(.*?)\s+=\s+(.*?)</title>} $html match fromamount toamount]} {
      puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
   } else {
      puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
   }

_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Wed Jan 27, 2010 8:28 am    Post subject: Reply with quote

speechles wrote:
shahrul wrote:
hi speechles,

the code still error.

Code:
Tcl error [xepub]: bad switch "--nocase": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or --


can u fix again and upload the new file?


Wow.. Third time is the charm I guess. Seems not only did I screw up splitting the line for easy forum viewing I also added an extra hypen to --nocase.. This is because webby requires double hypens and since I used it as an example this carried over into the static regular expression created. Proof I'm human, we make mistakes. The below _should_ fix all the prior problems and actually work this time. Wink

Change this part:
Code:
   if {[regexp {>Live rates at (.*?)</span>} $html match xetime] \
   && [regexp {<td width="45%" align="right" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match fromamount] \
   && [regexp {<td width="45%" align="left" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match toamount]} {
      regsub -all {<!.*?>} $fromamount {} fromamount
      regsub -all {<!.*?>} $toamount {} toamount
      puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
   } else {
      puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
   }


To this:
Code:
   if {[regexp {>Live rates at (.*?)</span>} $html match xetime] && [regexp -nocase {<title>.*?rate\:\s+(.*?)\s+=\s+(.*?)</title>} $html match fromamount toamount]} {
      puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
   } else {
      puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
   }



speechles, the code you give is working this time.. thanks you very much
Smile
Back to top
View user's profile Send private message
Bonnie
Voice


Joined: 09 Dec 2004
Posts: 23

PostPosted: Fri Jan 29, 2010 8:59 am    Post subject: Reply with quote

Hi All
I have been getting this error for some time.
"Could not obtain results from XE.com, sorry! "
I suspect it is my script.
What is the latest update.
Any ideas?
Thanks for all the good work here
Bonnie
Back to top
View user's profile Send private message
Bonnie
Voice


Joined: 09 Dec 2004
Posts: 23

PostPosted: Wed Feb 03, 2010 9:15 am    Post subject: Reply with quote

Sorry
I feel a bit dumb. I re-read the earlier posts. Then changed the bits of code. It works just fine.
Sorry again for being dumb.

Bonnie
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Thu Feb 25, 2010 10:47 am    Post subject: Reply with quote

I discovered today that this script has stopped working.

I decided the time had come to move away from XE.com and consequently this script...

Here's what I've done instead:

http://www.hm2k.com/posts/universal-currency-converter-tcl-for-eggdrop
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun Feb 28, 2010 7:33 am    Post subject: Reply with quote

Nice work again, hm2k Smile

Now we have a weather, worldtime and currency converter which are unlikely to stop working like other http scripts.

About this ucc.tcl, could I change "$info(date)" output format? Confused

Thanks.
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Sun Feb 28, 2010 4:27 pm    Post subject: Reply with quote

Hi,

i just tested the bot and this script is work fine.

just change a bit code on above post.

thanks
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Sun Feb 28, 2010 4:42 pm    Post subject: Reply with quote

shahrul wrote:
Hi,

i just tested the bot and this script is work fine.

just change a bit code on above post.

thanks


It doesn't work unless you make changes, further more it may be subject to changes again later, which means it may stop working again.

Try this instead: http://hm2k.googlecode.com/svn/trunk/code/tcl/ucc.tcl

It's not subject to these changes as it uses an API instead.

Torrevado wrote:
About this ucc.tcl, could I change "$info(date)" output format? Confused


added $ucc(dateformat) into ucc.tcl v0.1.1, hope this helps!
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Tue Mar 02, 2010 6:00 am    Post subject: Reply with quote

hm2k wrote:
added $ucc(dateformat) into ucc.tcl v0.1.1, hope this helps!

It did, thank you very much.
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Mon May 24, 2010 11:20 am    Post subject: Reply with quote

Hi folks,

I recommend you upgrade to latest...

http://hm2k.googlecode.com/svn/trunk/code/tcl/ucc.tcl

Thanks.
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Tue Aug 17, 2010 2:09 pm    Post subject: Reply with quote

speechless,

can you upgrade this scripts? seem error right now.

thanks
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Tue Aug 17, 2010 5:08 pm    Post subject: Reply with quote

speechless didn't write the ucc.tcl, I did.

The bug was fixed, get:

http://hm2k.googlecode.com/svn/trunk/code/tcl/ucc.tcl
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Tue Aug 17, 2010 5:22 pm    Post subject: Reply with quote

hm2k wrote:
speechless didn't write the ucc.tcl, I did.

The bug was fixed, get:

http://hm2k.googlecode.com/svn/trunk/code/tcl/ucc.tcl

Not to um.. burst your bubble.. but, I think he meant the fixes I gave to update rosc2112's (this is her topic after all not ucc's) aging and breakable xe.com script.

http://forum.egghelp.org/viewtopic.php?t=12653&start=32

@sharul, This fix no longer cuts it, their html obviously has changed. Check back in a few hours and I'll have an updated regexp template collection to fix the parsing.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
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