emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [org-feed] Remember the Milk - active timestamps
@ 2010-02-25 21:10 Sven Bretfeld
  2010-03-04 16:49 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Bretfeld @ 2010-02-25 21:10 UTC (permalink / raw)
  To: emacs-org

Hi list-members

Today, I configured org-feed to catch RSS feeds from RTM. For
Appointments I wrote a template that was intended to convert
RTM-schedules to org timestamps (i.e. the date of the appointment). 

:template "* APPT %title\n %T"

This doesn't work, because what is converted by %T is not the schedule
but the creation date of the RTM-entry.

Has anybody solved this problem?

Greetings,

Sven

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

* Re: [org-feed] Remember the Milk - active timestamps
  2010-02-25 21:10 [org-feed] Remember the Milk - active timestamps Sven Bretfeld
@ 2010-03-04 16:49 ` Carsten Dominik
  2010-03-04 18:33   ` Sven Bretfeld
  2010-03-04 18:33   ` Sven Bretfeld
  0 siblings, 2 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-03-04 16:49 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-org

Hi Sven,

how is the appointment time visible in the RTM stream?  Are they using  
a special tag for it or so?

- Carsten

On Feb 25, 2010, at 10:10 PM, Sven Bretfeld wrote:

> Hi list-members
>
> Today, I configured org-feed to catch RSS feeds from RTM. For
> Appointments I wrote a template that was intended to convert
> RTM-schedules to org timestamps (i.e. the date of the appointment).
>
> :template "* APPT %title\n %T"
>
> This doesn't work, because what is converted by %T is not the schedule
> but the creation date of the RTM-entry.
>
> Has anybody solved this problem?
>
> Greetings,
>
> Sven
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: [org-feed] Remember the Milk - active timestamps
  2010-03-04 16:49 ` Carsten Dominik
  2010-03-04 18:33   ` Sven Bretfeld
@ 2010-03-04 18:33   ` Sven Bretfeld
  2010-03-04 20:27     ` Carsten Dominik
  1 sibling, 1 reply; 5+ messages in thread
From: Sven Bretfeld @ 2010-03-04 18:33 UTC (permalink / raw)
  To: emacs-org

Hi Carsten

Carsten Dominik <carsten.dominik@gmail.com> writes:

> how is the appointment time visible in the RTM stream?  Are they using
> a special tag for it or so?

They have a really weak management for dates. Everything that exceeds
the due-time by more than one week, is awkward to insert (especially on
a phone) and very buggy and unstable. Yes, they have a special tag
inside the stream, but in the meantime I think it's not worth worrying
how to grab and convert it.

Now, I solved the case by inserting a couple of digits directly into the
headline and change it with an org-feed-after-adding-hook:

,----RTM
| 
| This is a date @@10030411:15-12:45
| 
`----

It will be converted into:

,----Orgmode
| 
| ** This is a date
|    <2010-03-04 11:15-12:45>
| 
`----

by this function:

--8<---------------cut here---------------start------------->8---
(defun rtm-dateconvert ()
  (interactive)
  (beginning-of-buffer)
    (while (re-search-forward "@@\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9]*[0-9]+:[0-9][0-9]\\)\\([-]*[0-9]*[0-9]*[:]*[0-9]*[0-9]*\\)" nil t)
      (replace-match "\n <20\\1-\\2-\\3 \\4\\5>" nil nil))
  (save-buffer "mygtd.org"))

(add-hook 'org-feed-after-adding-hook 'rtm-dateconvert)
--8<---------------cut here---------------end--------------->8---

So far it works. But it's not very elegant to jump to the beginning of
the buffer in the first step. I couldn't find out how to restrict
re-search-forward to only the current line. If that is possible, one
could get rid of the necessity of the @@.

There are still some other problems in using RTM with org-feed. I will
start a new thread on them. If they can be solved, I can absolutely
recommend RTM for orgmode users who own an Android phone (there is a RTM
app in the Market), especially since Reqall is not yet available in most
parts of Europe and OrgMobile for Android is not yet fully usable.

Greetings,

Sven

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

* Re: [org-feed] Remember the Milk - active timestamps
  2010-03-04 16:49 ` Carsten Dominik
@ 2010-03-04 18:33   ` Sven Bretfeld
  2010-03-04 18:33   ` Sven Bretfeld
  1 sibling, 0 replies; 5+ messages in thread
From: Sven Bretfeld @ 2010-03-04 18:33 UTC (permalink / raw)
  To: emacs-org

Hi Carsten

Carsten Dominik <carsten.dominik@gmail.com> writes:

> how is the appointment time visible in the RTM stream?  Are they using
> a special tag for it or so?

They have a really weak management for dates. Everything that exceeds
the due-time by more than one week, is awkward to insert (especially on
a phone) and very buggy and unstable. Yes, they have a special tag
inside the stream, but in the meantime I think it's not worth worrying
how to grab and convert it.

Now, I solved the case by inserting a couple of digits directly into the
headline and change it with an org-feed-after-adding-hook:

,----RTM
| 
| This is a date @@10030411:15-12:45
| 
`----

It will be converted into:

,----Orgmode
| 
| ** This is a date
|    <2010-03-04 11:15-12:45>
| 
`----

by this function:

--8<---------------cut here---------------start------------->8---
(defun rtm-dateconvert ()
  (interactive)
  (beginning-of-buffer)
    (while (re-search-forward "@@\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9]*[0-9]+:[0-9][0-9]\\)\\([-]*[0-9]*[0-9]*[:]*[0-9]*[0-9]*\\)" nil t)
      (replace-match "\n <20\\1-\\2-\\3 \\4\\5>" nil nil))
  (save-buffer "mygtd.org"))

(add-hook 'org-feed-after-adding-hook 'rtm-dateconvert)
--8<---------------cut here---------------end--------------->8---

So far it works. But it's not very elegant to jump to the beginning of
the buffer in the first step. I couldn't find out how to restrict
re-search-forward to only the current line. If that is possible, one
could get rid of the necessity of the @@.

There are still some other problems in using RTM with org-feed. I will
start a new thread on them. If they can be solved, I can absolutely
recommend RTM for orgmode users who own an Android phone (there is a RTM
app in the Market), especially since Reqall is not yet available in most
parts of Europe and OrgMobile for Android is not yet fully usable.

Greetings,

Sven

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

* Re: [org-feed] Remember the Milk - active timestamps
  2010-03-04 18:33   ` Sven Bretfeld
@ 2010-03-04 20:27     ` Carsten Dominik
  0 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2010-03-04 20:27 UTC (permalink / raw)
  To: Sven Bretfeld; +Cc: emacs-org


On Mar 4, 2010, at 7:33 PM, Sven Bretfeld wrote:

> Hi Carsten
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> how is the appointment time visible in the RTM stream?  Are they  
>> using
>> a special tag for it or so?
>
> They have a really weak management for dates. Everything that exceeds
> the due-time by more than one week, is awkward to insert (especially  
> on
> a phone) and very buggy and unstable. Yes, they have a special tag
> inside the stream, but in the meantime I think it's not worth worrying
> how to grab and convert it.
>
> Now, I solved the case by inserting a couple of digits directly into  
> the
> headline and change it with an org-feed-after-adding-hook:
>
> ,----RTM
> |
> | This is a date @@10030411:15-12:45
> |
> `----
>
> It will be converted into:
>
> ,----Orgmode
> |
> | ** This is a date
> |    <2010-03-04 11:15-12:45>
> |
> `----
>
> by this function:
>
> --8<---------------cut here---------------start------------->8---
> (defun rtm-dateconvert ()
>  (interactive)
>  (beginning-of-buffer)
>    (while (re-search-forward "@@\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\ 
> ([0-9][0-9]\\)\\([0-9]*[0-9]+:[0-9][0-9]\\)\\ 
> ([-]*[0-9]*[0-9]*[:]*[0-9]*[0-9]*\\)" nil t)
>      (replace-match "\n <20\\1-\\2-\\3 \\4\\5>" nil nil))
>  (save-buffer "mygtd.org"))
>
> (add-hook 'org-feed-after-adding-hook 'rtm-dateconvert)
> --8<---------------cut here---------------end--------------->8---

This is a good solution!  I think one could to a lot more smart  
reading in this way....

>
> So far it works. But it's not very elegant to jump to the beginning of
> the buffer in the first step. I couldn't find out how to restrict
> re-search-forward to only the current line. If that is possible, one
> could get rid of the necessity of the @@.

Why only the current line?  Are you sure that you are not dealing with  
a multi-line text?

Anyway, yes you can:

(goto-char (point-at-bol))
(looking-at ".*?AndThenYourRegexpHere")

HTH

- Carsten

>
> There are still some other problems in using RTM with org-feed. I will
> start a new thread on them. If they can be solved, I can absolutely
> recommend RTM for orgmode users who own an Android phone (there is a  
> RTM
> app in the Market), especially since Reqall is not yet available in  
> most
> parts of Europe and OrgMobile for Android is not yet fully usable.
>
> Greetings,
>
> Sven
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

end of thread, other threads:[~2010-03-04 20:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 21:10 [org-feed] Remember the Milk - active timestamps Sven Bretfeld
2010-03-04 16:49 ` Carsten Dominik
2010-03-04 18:33   ` Sven Bretfeld
2010-03-04 18:33   ` Sven Bretfeld
2010-03-04 20:27     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).