This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

incith:acronym (r128) (Sep. 13th, 2009)

Support & discussion of released scripts, and announcements of new releases.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

incith:acronym (r128) (Sep. 13th, 2009)

Post by incith »

Newest versions of my scripts are always available @ incith.com if they are not yet available on the Tcl archive.

Acronym searches from http://acronyms.silmaril.ie/cgi-bin/uncgi/acronyms. !a <acronym>. Suggestions welcome. :)

-r128: script is working again at new url.
Last edited by incith on Sun Sep 13, 2009 10:08 pm, edited 12 times in total.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

first bug report woo me :)

Post by rosc2112 »

First, THANK YOU INCITH!! Don't worry about the competiting script in the tcl archive, it doesn't even work :P Not to mention lacks the features yours has ;)

Next, a bug: When I searched for "lmao" the script only showed 2 of 3 responses, although I do have the limit set to 5. Curiously, it was the middle def that was not shown.

Then, some suggestions (I've only been testing for like 4 minutes so I'll prolly have more to pester you with later ;)

Put in a usage msg if you type just ".acronym" - I put in a little line that just says "Usage: .acro <acronym to lookup>"

Perhaps add some indication of how many matches were found, and we're only showing [5/10000] or something so the user knows there were more entries not shown.

Another idea, since acronymfinder.com splits defs into categories, perhaps you could work in an option to let the user see the categories that the match was found in, and then they could pick the category, like:
.acro categoryname: acronym
(take a look at the dictionary.com script I did, for example, I put in a dbmatch option to show which db a word is in, and an option to pick which db to get the word from) Or even possibly let the user pick the definition number to show (similar to Perplexa's urban dictionary script).

Just some ideas to kick around :)

And yeah, I agree with hating the chanset stuff, but I'll hack my own "set acrochans" thingy into my copy ;)

Thanks again for another well-done script to add to the bots :)
InfoBot eat your heart out! :P
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Hah, seems I'm not parsing the results with the blue table background color. Thanks for that catch.. I was wondering why TIAS did not return Try It And See!

Anyway, I'll get to work on it, 1.1 is the initial version + &amp quick-fix, but glad to see someone is interested, I'll get 1.2 up sometime.

Edit: 1.2 has been submitted and is linked to in the first post, just a quick fix release to make sure all the results are getting parsed. As for categories that's something I'll have to think about, as I'm not sure they'd be entirely useful on a site such as this.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

v1.3 released, can be downloaded from the first post.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

diff to add total matches found

Post by rosc2112 »

Hi Incith,

I thought I'd offer the following small hack I added to show the total results found (cos I'm one of *those* people who like to know these things ;)

This is a unified 'diff' with no extra parameters:

Code: Select all

@@ -269,6 +248,10 @@
       if {[regexp {no acronym matches for <strong>} $html]} {
         set output(error) "The requested acronym was not found."
       }
+       # my hack for showing total matches found -rosc
+       set totalmatches ""
+       regexp {>Your acronym search<br>returned (.*?) meanings} $html match totalmatches
+
       # acronyms
       while {$results < $incith::acronym::max_results} {
         # the regexp grabs the data and stores them into their variables, while
@@ -285,7 +268,17 @@
       }
 
       if {[info exists final_output] == 1} {
-        set output(acronym) $final_output
+       # my hack to show total matches found -rosc
+       if {$totalmatches != ""} {
+               if {$results <  $incith::acronym::max_results} {
+                       set maxresults $results
+               } else {
+                       set maxresults $incith::acronym::max_results
+               }
+               set output(acronym) "(Showing $maxresults of \002$totalmatches\002 matches): $final_output"
+       } else {
+               set output(acronym) $final_output
+       }
       }
 
       # this returns our 'output' array
It's slightly ugly and could probably be better integrated elsewhere but I didn't want to muck things up too much. The result looks like:

LEO: (Showing 5 of 20 matches):

LMAO: (Showing 3 of 3 matches):
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

It can be better to use [info exists total_matches] as if {$total_matches} will produce an error if it doesn't exist as a var. Yes, I realize you [set] it.

Thanks for the idea, I'll add it in for the next release. I have some plans brewing for all my scripts. :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Ohh I wish I knew how to do fancy scripting/programming like yours, mine's like beef stew compared to beef wellington! <grin>
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Oh please. I'm a newb coder. I just like sharing small tips like that, keeps everyone a bit more knowledged in the end :) Helping you helping me.. heh!
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

incith:acronym is dead! Got an e-mail with a subject of Cease and desist when I woke up today:
Cease and desist wrote:Please stop writing and distributing scripts that illegally scrape the
copyrighted content of acronymfinder.com

This violates our terms of use and international copyright law.

Mike Molloy
AcronymFinder.com
So with that, I've asked slennox to remove incith:acronym from the Tcl archive, and I will not be publishing anymore versions of it.

Regards,

Update: I've e-mailed him back stating I would look into this matter further, as I don't believe you can copyright acronyms, nor do I believe he holds copyright to all the acronyms on that website nor do I believe that he could hold copyright to all the acronyms as their is a user submissions area. Further I do not believe scraping non-copyright material is illegal even with his terms of usage disclaimer. If anyone here is a lawyer or can shed further light on this, I'd be appreciative.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

First of all, email does NOT constitute proof of service, so I'd ignore the twits until you receive certified mail (and good luck to the twits finding your real name and address :P) Those C&D letters are purely intimidation tactics. Go do a google search for "cease and desist letters" and you'll find plenty of forums devoted to the subject, and likely be able to get some legal info about how to fight the pricks. If you do get a certified letter with a properly worded C&D demand (research what is required for it to be legal), let us know.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I just read their terms of service.. You're not violating them because you're not downloading, nor are you "automatically scraping" - you are doing what they allow - which is the same damn thing a webbrowser does.. So, call your script a webbrowser, it's a matter of semantics. About the only condition I see that you should comply with is:

All search results from this site must appear with the site's advertising and copyright information.

So put their stupid copyright into the script.. You should be able to explain to the twit what the script does (which is not automated) and obtain permission and give proper credit to their site, etc. They provide "free tools" for webbrowsers, so explain that your script is a "free tool" for irc.. There's very little difference.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Ohh and as far as their advertising - I use adblock for mozilla so I do not even get their advertising - are they going to block me for not accepting their lame ads? heh..
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

rosc, thanks for your replies and efforts. Before coming back here I also had the same thought, "My script is no more than a web-browser. A limited one."

I will make some changes to the script in a few days, perhaps advertising AcronymFinder.com: in the results.

I will add a section to the header with their copyright info, and perhaps display AcronymFinder.com in the results that get sent to the channel. I just don't want this to escalate really.

The e-mail also did not come from @acronymfinder.com, which leads me to believe it is ignore-worthy.
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

I am now being directed to http://acronymfinder.com/uselimit.asp when I attempt to search. *laugh*
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Ohh geez they blacklisted you're ip? I just changed the user agent string, and I do get the html results in my putcmdlog debuggy thing, but the output is broke again, showing 0 results on the chan.. Heh I just got a "user limit exceeded" page whilst trying to debug..Ya know what, there are less ANAL RETENTIVE acronym databases freely available, so if this jitwad wants to do this kind of childish crap (Hey get a freakin life and quit reading weblogs ya dork) I suggest ya just use one of the MUCH MUCH BETTER FREE acronym sites:

http://acronyms.thefreedictionary.com/
http://en.wikipedia.org/wiki/Acronym
http://www.all-acronyms.com/
http://www.acronymsearch.com/index.php
http://www.google.com/search?hl=en&q=ac ... gle+Search

and so on and on and on.. Mikey isn't the only game in town.

Who needs that dorky spam-ridden site anyway <thinks Mike Molloy needs to get a new hobby>
Post Reply