Gnus development mailing list
 help / color / mirror / Atom feed
* agent off-line and URLs
@ 1998-02-02 18:10 Wes Hardaker
  1998-02-08 15:54 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Wes Hardaker @ 1998-02-02 18:10 UTC (permalink / raw)



Hmm...  It'd be nice to have a switching URL function that launched
the web browser only if gnus was plugged, and otherwise saved the
URL's to a *URL* buffer or something so that you could look at them
later when you re-connected (maybe even bring it up on a J j).

-- 
"Ninjas aren't dangerous.  They're more afraid of you than you are of them."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-02 18:10 agent off-line and URLs Wes Hardaker
@ 1998-02-08 15:54 ` Lars Magne Ingebrigtsen
  1998-02-09 16:09   ` Wes Hardaker
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-02-08 15:54 UTC (permalink / raw)


Wes Hardaker <wjhardaker@ucdavis.edu> writes:

> Hmm...  It'd be nice to have a switching URL function that launched
> the web browser only if gnus was plugged, and otherwise saved the
> URL's to a *URL* buffer or something so that you could look at them
> later when you re-connected (maybe even bring it up on a J j).

Yes, that would be nice, but I think this should be handled from
outside Gnus.  Gnus could call, like, `browse-url-fetch-deferred' (or
something), but keeping track of URLs and stuff is something that
doesn't belong in Gnus proper.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-08 15:54 ` Lars Magne Ingebrigtsen
@ 1998-02-09 16:09   ` Wes Hardaker
  1998-02-11 22:27     ` Dave Love
  0 siblings, 1 reply; 7+ messages in thread
From: Wes Hardaker @ 1998-02-09 16:09 UTC (permalink / raw)


>>>>> On 08 Feb 1998 16:54:01 +0100, Lars Magne Ingebrigtsen <larsi@gnus.org> said:

Lars> Yes, that would be nice, but I think this should be handled from
Lars> outside Gnus.  Gnus could call, like,
Lars> `browse-url-fetch-deferred' (or something), but keeping track of
Lars> URLs and stuff is something that doesn't belong in Gnus proper.

1)  Someone suggested wwwoffle, which would work, and essentially just 
    a proxie.  More than I really wanted.

2)  You're right, it should probably be external, but its too small
    really to distribute by itself (I wrote it yesterday):

(defun my-browse-and-cache (URL) 
  "browser the URL using netscape if online, else store it in *WWW-cache*"
  (interactive)
  (if (string-equal (second gnus-agent-mode-status) " Plugged")
      (browse-url-netscape URL)
    (save-excursion
	(set-buffer "*WWW-cache*")
	(end-of-buffer)
	(let ((p (point)))
	  (insert (format "(browse-url-netscape \"%s\")\n" URL))
	  (gnus-article-add-button p (point-max) 'browse-url-netscape URL)
	))))


Granted, I made one mistake I haven't fixed where I assume set-buffer
creates the buffer (it doesn't, I just noticed this morning) and I
call netscape's function call rather than doing a, um, (funcall)
directly...

-- 
"Ninjas aren't dangerous.  They're more afraid of you than you are of them."


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-09 16:09   ` Wes Hardaker
@ 1998-02-11 22:27     ` Dave Love
  1998-02-11 22:41       ` Hrvoje Niksic
                         ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dave Love @ 1998-02-11 22:27 UTC (permalink / raw)


As browse-url muggins if it's useful, I'll implement a browse-url
function to allow you to snarf URLs offline to a file (presumably).
You could then set browse-url-browser-function to it as appropriate.
That's easy.  Is there a good suggestion for a _simple_ way to use the
results online afterwards?  For instance, just invoking browse-url N
times in succession (asynchronously) and emptying the file isn't
right, I think.  [I don't know anything about existing implementations
of that sort of thing.]


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-11 22:27     ` Dave Love
@ 1998-02-11 22:41       ` Hrvoje Niksic
  1998-02-12  0:44       ` Frank D. Cringle
  1998-02-12 15:55       ` jari.aalto
  2 siblings, 0 replies; 7+ messages in thread
From: Hrvoje Niksic @ 1998-02-11 22:41 UTC (permalink / raw)


This kind of depends on what you want to do with the URLs.  If you
just want to browse them, then there is no real solution -- you simply 
have to know when you are "done" with one URL to start browsing the
other.

OTOH, if you simply want to download the contents of the URLs, you can 
pass them all to a non-interactive retriever like Wget.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
main(){printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-11 22:27     ` Dave Love
  1998-02-11 22:41       ` Hrvoje Niksic
@ 1998-02-12  0:44       ` Frank D. Cringle
  1998-02-12 15:55       ` jari.aalto
  2 siblings, 0 replies; 7+ messages in thread
From: Frank D. Cringle @ 1998-02-12  0:44 UTC (permalink / raw)


Dave Love <d.love@dl.ac.uk> writes:
> As browse-url muggins if it's useful, I'll implement a browse-url
> function to allow you to snarf URLs offline to a file (presumably).
> You could then set browse-url-browser-function to it as appropriate.
> That's easy.  Is there a good suggestion for a _simple_ way to use the
> results online afterwards?  For instance, just invoking browse-url N
> times in succession (asynchronously) and emptying the file isn't
> right, I think.  [I don't know anything about existing implementations
> of that sort of thing.]

I just drop them into an HTML file and browse that file later when I
am online.  Here is what I have been using since the days when
browse-url-browser-function was called gnus-button-url.  I have been
meaning to clean it up - particularly by inserting new URLs at the
front rather than the end.

;; Should delete whitespace at end of subject line and
;; translate & to &amp;
(defun fdc-note-url (url)
  "Deposit a URL in the user's note.html file.
Bind this function to gnus-button-url if you
prefer not to lookup URLs while reading news."
  (interactive "sURL: ")
  (set-buffer gnus-summary-buffer)
  (let ((group (or (car gnus-article-current) "???"))
	(article (or (cdr gnus-article-current) "???"))
	(subject (or (gnus-summary-article-subject) "???"))
	(buffer (find-file-noselect gnus-note-file)))
    (set-buffer buffer)
    (bury-buffer buffer)
    (if (<= (point-max) 1)		; empty or new file
	(progn
	  (insert "<TITLE>Noted URLs</TITLE>\n")
	  (insert (format "<H1>Extracted from news by %s</H1>\n"
			  (getenv "USER")))))
    (goto-char (point-min))
    (if (search-forward url nil t)
	(message "%s is already in %s." url gnus-note-file)
      (goto-char (point-max))
      (insert (format "<A HREF=\"%s\">%s[%s] %s</A><P>\n"
		      url group article subject))
      (save-buffer)
      (message "%s inserted in %s." url gnus-note-file))))

-- 
Frank Cringle,      fdc@cliwe.ping.de
voice: (+49 2304) 467101; fax: 943357


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: agent off-line and URLs
  1998-02-11 22:27     ` Dave Love
  1998-02-11 22:41       ` Hrvoje Niksic
  1998-02-12  0:44       ` Frank D. Cringle
@ 1998-02-12 15:55       ` jari.aalto
  2 siblings, 0 replies; 7+ messages in thread
From: jari.aalto @ 1998-02-12 15:55 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

| 98-02-11 Dave Love <d.love@dl.ac.uk> list.ding
|
| Is there a good suggestion for a _simple_ way to use the
| results online afterwards?  For instance, just invoking browse-url N
| times in succession (asynchronously) and emptying the file isn't
| right, I think.  [I don't know anything about existing implementations
| of that sort of thing.]

This offline URL cacheing idea facinated me, so I added support to
the latest release of my tinyurl.el minor mode. If anybody is
interested here is how the story goes:

Either:
- Turn on tiurl-mode for Gnus buffers and the offline/online detections
  is automatic. When gnus is unplugged, the urls are stored to *URL-cache*
  buffer. Go there and push the urls when you're online again.

OR

- Replace Gnus and TM browser with this snippet and have tinyurl.el package
  somewhere along load-path. 

Complete docs for package can be found here. (The new feature is not yet
documented in html page, nor it is implemented in the version located in
the ftp site, please wait for the news tiny tools release)

    ftp://cs.uta.fi/pub/ssjaaa/ema-tiny.html#417

Cheers!
jari

    


[-- Attachment #2: Type: text/plain, Size: 1088 bytes --]


(autoload 'tiurl-mode "tinyurl" t t)

;;; ----------------------------------------------------------------------
;;;
(defun my-gnus-browse-and-cache (URL)
  "Browse the URL if online, else use TinyUrl"
  (interactive)
  (setq URL  (gnus-strip-whitespace URL))
  (if (string= (second gnus-agent-mode-status) " Plugged")
      (funcall browse-url-browser-function URL)
    (when (fboundp  'tiurl-mode)        ;Let this handle offline URL (cache)
      (require 'tinyurl)
      (tiurl-cache-url URL)
      )))


;;; ----------------------------------------------------------------------
;;;
(defun my-gnus-art-load-hook ()
  "Override article settings."
  ;;  Replace functions.
  (defalias 'gnus-button-url            'my-gnus-browse-and-cache)
  (defalias 'gnus-button-embedded-url   'my-gnus-browse-and-cache)

  ;;  TM occupies Gnus  buffers too, redirect the "push" button.
  (if (featurep 'tm-setup)
      (defalias 'tm:browse-url 'my-gnus-browse-and-cache))
  )



(add-hook 'gnus-art-load-hook 'my-gnus-art-load-hook)
(if (featurep 'gnus-art) (my-gnus-art-load-hook)) ;Reload now



[-- Attachment #3: Type: text/plain, Size: 1965 bytes --]

Tinyurl.el -- Marks all urls on current line in any buffer.

    Overview of features
  
        o   When this global minor mode is on, wait few seconds and the
            current line will scanned for url buttons. Because not all
            terminals show clolor, there is additional "!" character added to
            the front of URL for calling you to *push* it.
        o   Once the minor mode is turned on, it occupies every buffer,
            but there is also function to turn the mode on or off per buffer
            basis, see `tiurl-mode-1'.
        o   Defines binding `mouse-2' and *ESC* *RET* to view the url at
            point. These bindings are electric: If there is no button to push,
            call original binding according to underlying mode.
        o   You can change the set of url handler on the fly: eg.
            call lynx for a while, then switch to Netscape or use your custom
            browser.
        o   Requirements: In XEmacs, you must have overlay.el package available.


[to be added to docs...]

      Cacheing URLs for later use (offline reading)
  
        If you're not connected to the Net, then it doesn't make sense
        to call browser directly, but instead cache the pushed urls
        to separate buffer. When you're online again, you can go to the
        cache buffer and relaunch pointers.
  
        The offline reading is usual in Gnus, where you can toggle between
        "plugged" and "unplugged" Gnus. The default unpluggged condition
        detector is `tiurl-unplugged-p'. It returns nil if you're running
        Gnus and it's in unplugged state.
  
        You can place your own unlpugged state detector to variable
        `tiurl-:unplugged-function'. Cache buffer used is
        `tiurl-:url-cache-buffer', which is *URL-cache* by default.
  
    Support for programming language URLs
  
        [C/C++] ...snip
        [Perl] ...snip
        [lisp] ...snip
        [Other languages]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1998-02-12 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-02 18:10 agent off-line and URLs Wes Hardaker
1998-02-08 15:54 ` Lars Magne Ingebrigtsen
1998-02-09 16:09   ` Wes Hardaker
1998-02-11 22:27     ` Dave Love
1998-02-11 22:41       ` Hrvoje Niksic
1998-02-12  0:44       ` Frank D. Cringle
1998-02-12 15:55       ` jari.aalto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).