On Tue, Oct 21, 2014 at 7:14 PM, John Found <[email protected]> wrote:

> Ah, it is clear now. But this approach (and the RSS feed as well), has one
> big disadvantage - I need to parse HTML (or XML) format aimed to be read by
> a human. Of course, such data scrapping is possible, but isn't there more
> elegant/machine oriented way...
>

XML is most definitely machine-oriented, but not necessarily easy to parse
with most APIs/tools.

Okay, i think i have it... Let's try:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/raw/version.txt?name=trunk

That will give you the checkin record for the top of the given branch
(name=BRANCHNAME) and getting the version from that is trivial:

[stephan@host:~/]$ sha1sum ~/Downloads/version.txt
954a12be681d10ad5eddfd17c1918769140cecdd
 /home/stephan/Downloads/version.txt

Indeed, 954a12be is the tip of the trunk branch at the moment. Alternately,
no temp file is needed:

[stephan@host:~/cvs/fossil]$ wget -q -O -
http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/raw/version.txt?name=trunk
| sha1sum | cut -d' ' -f1
954a12be681d10ad5eddfd17c1918769140cecdd


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to