[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: automatically filling out WordPress comment fields
- From: Naohiro Aota <naota@xxxxxxxxx>
- Date: Fri, 06 Feb 2009 20:55:21 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 10683
- References: <b4meiycbha7.fsf@xxxxxxx> <8763johwdy.fsf@xxxxxxxxxxx>
jidanni@xxxxxxxxxxx writes:
> KY> I'm not sure it is the right approach but how about this plan?
> KY> Add the following two user options to somewhere in w3m-form.el:
> OK, that maybe is a good plan. But one might want to match on
> <meta name="generator" content="WordPress ...>
> and perhaps some other conditions, to ensure one does not unknowingly
> enter ones credentials into forms one was not intending to.
>
> Anyway, I am still very curious how I can make a function to help me
> fill in the next three form fields when ever I want to thusly:
>
> <tab> <return> C-a C-k j i d a n n i <return> <tab> <return> C-a C-k j
> i d a n n i @ j i d a n n i . o r g <return> <tab> <return> C-a C-k h
> t t p : / / j i d a n n i . o r g / <return> <tab>
>
> Is the only way to make a keyboard macro?
>
> I can get as far as (w3m-next-anchor) but then I don't know how to
> program typing something into the minibuffer at that point. I looked
> in the source to see how you do it, but
> $ grep TEXT /usr/share/emacs/site-lisp/w3m/*.el
> doesn't find how you prompt with "TEXT:"
That is done by `w3m-form-input'. You might be able to do what you want
like the following.
(save-excursion
(w3m-next-form)
(let* ((act (get-text-property (point) 'w3m-action))
(form (cadr act))
(id (caddr act))
(name (cadddr act))
(input "foobar"))
(w3m-form-put form id name input)
(w3m-form-replace input)))
Regards,