Re: [tw5] Re: Download a Tiddler Using Python/Bash

2018-05-18 Thread Jeremy Ruston
If you end up writing something from scratch, you might want to refer to the 
fairly simple code that TW5 uses to extract the tiddlers from TWC/TW5 HTML 
files:

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/deserializers.js#L107-L133
 


Best wishes

Jeremy

> On 18 May 2018, at 16:28, Matthew Lauber  wrote:
> 
> I don't think there's really anything else someone's made.  You can try to do 
> HTML munging using BeautifulSoup in python.  Should be able to use something 
> like:
> 
> with open("NameOfFile.html") as f:
>  soup = BeautifulSoup(f.read(), "html.parser")
> 
> 
> soup.find_all('div', attrs={'title': 'NameOfTiddler'})
> 
> That'll get the the Div that represents the tiddler, but you'll have to 
> figure out how to parse it.  And it relies on BeautifulSoup4, which you can 
> get with 
> pip install beautifulsoup4
> 
> 
> 
> 
> On Friday, May 18, 2018 at 8:20:29 AM UTC-4, j3d1H wrote:
> Jed: I would really rather not use node, it hasn't worked very well for me in 
> the past. Any other possible solution?
> 
> -- 
> 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 post to this group, send email to tiddlywiki@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/aafd5a26-5450-40bc-b080-4dd12f94e2fe%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/43438949-4477-41D9-9A63-47F8D3B1E5D2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] Re: Download a Tiddler Using Python/Bash

2018-05-17 Thread Arlen Beiler
Well, the ginsu script would already be bash, or something similar. You
need the node executable to run the script but you can call it from python
or bash and then process the output.

On Thu, May 17, 2018, 15:53 Jed Carty  wrote:

> You may be able to do it using node, there is a script called ginsu in the
> repo that splits a wiki into tiddlers but I am not sure how to convert it
> to use python or bash.
>
> https://github.com/Jermolene/TiddlyWiki5/blob/master/bin/ginsu.sh
>
> --
> 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 post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/216c309e-91e9-4e01-8fb9-ad0240cfe290%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAJ1vdSRpj3A71hUbrHyDfvvuch4AVBnb_pSyOby9Uf0tMMBQRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.