erbot-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erbot-cvs] Changes to erbot/erbc.el


From: Pete Kazmier
Subject: [Erbot-cvs] Changes to erbot/erbc.el
Date: Sat, 08 Jan 2005 16:21:42 -0500

Index: erbot/erbc.el
diff -u erbot/erbc.el:1.80 erbot/erbc.el:1.81
--- erbot/erbc.el:1.80  Sat Jan  8 17:53:08 2005
+++ erbot/erbc.el       Sat Jan  8 20:45:29 2005
@@ -532,6 +532,9 @@
   (list 1)
   "")
 
+(defcustom fs-web-page-title-p nil
+  "Change it to t to enable the erbot to look up the title of urls
+posted in a channel.  When string, will be matched against target.")
 
 (defcustom fs-m8b-p nil
   "Change it to t for the magic 8-ball... define m8b then of
@@ -690,8 +693,8 @@
        (when (equal 0 (string-match "," restmsg))
          (setq restmsg (substring restmsg 1)))
        (setq msg (concat erbot-nick ": " restmsg))))
-    
-    
+
+
     ;; now we split strings..
     (setq msg (split-string msg))
 
@@ -804,7 +807,26 @@
                          ))
          ))
       )
-    
+
+    ;; Sat Jan  8 12:40:46 EST 2005 (petekaz)
+    ;; We need to make sure this is the last thing we check
+    ;; because we don't want to hijack another valid command
+    ;; with our parsing.  I.e. if a user adds a term with an
+    ;; url included in its note, we don't process that.
+    (when (and leave-alone-p
+               fs-web-page-title-p
+               (if (stringp fs-web-page-title-p)
+                   (and (stringp tgt) 
+                        (string-match fs-web-page-title-p tgt))
+                 t))
+      (let* ((case-fold-search t)
+             (url (some (lambda (e)
+                          (when (string-match "^http://[^ ]+$" e)
+                            e))
+                        msg)))
+        (when url
+          (setq leave-alone-p nil)
+          (setq msg (list "(" "web-page-title" (format "%S" url) ")")))))
     
     ;;       (cond
     ;;        ((equal (length msg) 1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]