Projects / any-dl / Comments

Comments for any-dl

03 Jul 2013 12:45 ouser

Enhancing the last comment: When you have a file with URLs for which you want to create the desktop-files, then you can use this bash-script for this task:

#!/bin/bash

URLS_FILE=URL_LIST
PREFIX=generated_desktopfile_
FORMAT="%05d.desktop"
RESULTS=RES


any-dl -f create_desktoplink.adl -p desktop `paste $URLS_FILE -s` > $RESULTS


csplit $RESULTS --prefix=$PREFIX --suffix-format=$FORMAT /\#\ \-\-\-/ {*}

rm -v generated_desktopfile_00000.desktop # sorry for the radcoded name ;-)

03 Jul 2013 12:43 ouser

How to create desktop-links files for Gnome Desktop from a list or URLs?

It's about three lines of code, when using a certain parser for this task.

First you create a file, say "create_desktoplink.adl" and it contans the following:


parsername "desktop": ()
start
print( "[Desktop Entry]" );
print( "Encoding=UTF-8" );
titleextract;
store("title");
print("Name=", $title);
print("Type=Link");
print("URL=", $STARTURL);
print("Icon=gnome-fs-bookmark");
end

Then you call any-dl this way:

$ any-dl -f create_desktoplink.adl -p desktop <list_of_urls> > RESULTS

Then you need to split the results into seperated files:

$ csplit RESULTS --prefix=generated_desktopfile_ /\#\ \-\-\-/ {*}

Then you can remove the file with Index 00 with "rm".

Thats it.

17 May 2013 01:57 ouser

Feel free to write or enhance site-parsers and submit them to me.
I will possibly (not necessarily) add them to the any-dl-rc-file (possibly changed or unchanged).

02 Feb 2013 02:13 ouser

I forgot to mention in the README (added it now),
that the file "rc-file.adl" must be copied to
"$HOME/.any-dl.rc" so that the tool works out of the box.

I added it to the README in 0.9.2b

============================================

Setup
=====

The file "rc-file.adl" does contain needed parser-definitions
for any-dl to work as expected.
This file must be saved to the home-directory as file ".any-dl.rc".

So, please copy it from ./rc-file.adl" to $HOME/.any-dl.rc

$ cp rc-file.adl $HOME/.any-dl.rc

Alternatively you can use the "-f" option of any-dl
to tell any-dl, which file contains the parser-definitions.
============================================

Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.