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.

Url-script that knows duplicates.

Old posts that have not been replied to for several years.
Locked
b
beercan

Url-script that knows duplicates.

Post by beercan »

Anybody know of / have a script that remebers which urls that
has been posted and in the event of a duplicate tells the channel something like.

<bot> http://www.foo.org has been posted 4 times before, first post was by bar 1y 3w 5d and 22:12 ago.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I don't currently know any script which can do that. Still you might want to check on ftp://eggheads.org/ they have scripts since 1996. And some others such as egghelp.org and tclscript.com too!

Possible solution:
What you can do here is write every url sent into a channel into a file, followed the nick who said that url and the unixtime on which that url was said. Write each url into a newline of the file. You can make the bind trigger on words such as http://, ftp://, www., .com, .net, .org and etc.

Then when a url is sent, you can check by bind pubm, match certain url chars, try using lsearch or maybe string match and try to match any of those urls in the txt file database, if it matches count how many times it matches with a foreach or for loop. Then you can go ahead close the file and display your results.

Or alternatively you can save them in an array, do a foreach loop check if any match, then incr a variable to check how many times that url was posted if it matched any results, finally convert the unixtime string into your format along with the other stuff and go ahead and display the results
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked