[tw5] Re: Automatically create tiddlers from outside source

2020-07-15 Thread UBi
Regarding standalone Tiddliwikis, you could inject Tiddlers with Python 
like this:

from lxml import html
from lxml import builder as E
from datetime import datetime

infile, outfile = 'empty.html','modified.html'

def maketiddler(title,text):
timestamp = datetime.now().strftime('%Y%m%d%H%M%S%f')[:17]
fields = {'title' : title, 'modified' : timestamp}
return E.DIV(E.ATTR(fields),E.PRE(text))

tree = html.fromstring(open(infile,'rb').read())
tids = tree.get_element_by_id('storeArea')
tids.append(maketiddler('Test','Test Tiddler injected with Python'))
open(outfile,'wb').write(html.tostring(tree, include_meta_content_type=True, 
encoding='utf-8',doctype=''))


The resulting outfile is smaller than infile, html.tostring() leaves some 
characters unconverted the TiddlyWiki saver would convert to HTML entities.

Am Sonntag, 12. Juli 2020 19:54:39 UTC+2 schrieb LG:

> Is it possible to push updates to TW from outside sources which can create 
> a new toddler? I read that this might be possible with email.
>
> I like to write in Google Keep, but want to make sure my new note ends up 
> in TW too. It'd be great if I didn't have to manually copy it over.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dd8b9a07-91ed-4057-ac54-3a7bbf03c450o%40googlegroups.com.


[tw5] Re: Automatically create tiddlers from outside source

2020-07-12 Thread Lin Onetwo
There is Pull and Push:

For Pull, I have already pull Google Calendar to TW: 
https://onetwo.ren/wiki/#%E5%AF%BC%E5%85%A5GoogleCalendar%E7%9A%84%E6%8C%89%E9%92%AE

For Push, I'm using nodejs TW so I sync it to Github,
so I can just use Github API to append *.tid or *.txt with *.txt.meta file 
to Github repo,
use for example https://github.com/webclipper/web-clipper (but it is still 
implementing "save to github" feature)
Then I can git pull and get updated content in my local nodejs TW that has 
Bob plugin installed.


LinOnetwo
在2020年7月13日星期一 UTC+8 上午9:16:20 写道:

> LG,
>
> There are plenty of almost what you ask solutions, but as far as I can see 
> true consumption of external content is still at the bleeding edge. Joshua 
> is discussing something like this in the dev group here 
> 
>
> An existing method if the site allows is an iframe containing the source 
> and copy and paste/drag and drop into tiddlywiki.
>
> Google keep allows export to a google document, but this is still a multi 
> step process, which I use if I want to move a whole list to tiddlywiki.
>
> Eventually I hope to replace keep with a tiddlywiki for this kind of 
> reason. More control.
>
> Regards
> Tony
>
>
> On Monday, July 13, 2020 at 3:54:39 AM UTC+10, LG wrote:
>>
>> Is it possible to push updates to TW from outside sources which can 
>> create a new toddler? I read that this might be possible with email.
>>
>> I like to write in Google Keep, but want to make sure my new note ends up 
>> in TW too. It'd be great if I didn't have to manually copy it over.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bdd4f2de-93ce-4cb5-8494-6b0ccee9b3bfn%40googlegroups.com.


[tw5] Re: Automatically create tiddlers from outside source

2020-07-12 Thread TW Tones
LG,

There are plenty of almost what you ask solutions, but as far as I can see 
true consumption of external content is still at the bleeding edge. Joshua 
is discussing something like this in the dev group here 


An existing method if the site allows is an iframe containing the source 
and copy and paste/drag and drop into tiddlywiki.

Google keep allows export to a google document, but this is still a multi 
step process, which I use if I want to move a whole list to tiddlywiki.

Eventually I hope to replace keep with a tiddlywiki for this kind of 
reason. More control.

Regards
Tony


On Monday, July 13, 2020 at 3:54:39 AM UTC+10, LG wrote:
>
> Is it possible to push updates to TW from outside sources which can create 
> a new toddler? I read that this might be possible with email.
>
> I like to write in Google Keep, but want to make sure my new note ends up 
> in TW too. It'd be great if I didn't have to manually copy it over.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7f56d476-b103-4a74-a49f-de1af8542a03o%40googlegroups.com.


[tw5] Re: Automatically create tiddlers from outside source

2020-07-12 Thread Mat
Fellow Siniy-kit just last week posted a method to pull data from Google 
Sheets. That's probably a good start even if I'd guess there are many steps 
after that if you want it from Keep.

<:-)

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d9648cd2-d820-4941-b282-84dfa618326eo%40googlegroups.com.