summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Reisenweber <joerg@neo900.org>2016-12-01 07:13:35 +0100
committerGenerated from internal repo <nobody@neo900.org>2016-12-01 07:13:35 +0100
commite03c371dc4eaaf3c9c1813e170bedfd649c09cbc (patch)
tree94737dc772073b6d0bf36cea6b21fcdd8f83383e
parent56b0b4ffcca351eb56b020fc8448c9d15b9b2900 (diff)
downloadee-e03c371dc4eaaf3c9c1813e170bedfd649c09cbc.tar.gz
ee-e03c371dc4eaaf3c9c1813e170bedfd649c09cbc.tar.bz2
ee-e03c371dc4eaaf3c9c1813e170bedfd649c09cbc.zip
added a little hack to cope with silego rapidly changing URLs shellscript getsilego takes one parameter: searchstring - e.g. 46521 gendocdb.pl my very first perl hack, no idea what I did ;-) docdb.in new syntax element "DS `<shell $(command_to_execute)> <parameters>" backtick ` first char denotes the command will get executed and should return via STDOUT the URL of the PDF to download e.g: "DS `./getsilego 46533"
-rw-r--r--hw/docdb.in7
-rwxr-xr-xhw/gendocdb.pl17
-rwxr-xr-xhw/getsilego2
3 files changed, 20 insertions, 6 deletions
diff --git a/hw/docdb.in b/hw/docdb.in
index b23055e..0f95f05 100644
--- a/hw/docdb.in
+++ b/hw/docdb.in
@@ -40,12 +40,15 @@ DS http://www.ti.com/lit/ds/symlink/ina231.pdf
FP 34
U*_SLG46531
-DS http://www.silego.com/uploads/Products/product_415/SLG46531_DS_r109_10212016.pdf
+#DS http://www.silego.com/uploads/Products/product_415/SLG46531_DS_r109_10212016.pdf
+DS `./getsilego 46531
FP 168
U*_SLG46533V
-DS http://www.silego.com/uploads/Products/product_482/SLG46533r107_11152016.pdf
+#DS http://www.silego.com/uploads/Products/product_482/SLG46533r106_10202016.pdf
+DS `./getsilego 46533
FP 180
+# the footprint page is obviously not locked to the "random" file from getsilego. This could use more logs and love
U*_ADA4505-1*
DS http://www.analog.com/media/en/technical-documentation/data-sheets/ADA4505-1_4505-2_4505-4.pdf
diff --git a/hw/gendocdb.pl b/hw/gendocdb.pl
index 099fe8e..9eb0192 100755
--- a/hw/gendocdb.pl
+++ b/hw/gendocdb.pl
@@ -34,12 +34,21 @@ while (<MAP>) {
next;
}
die "bad document line" unless /^("[^"]*"|\S+)\s+/;
+ $xtag = "$1";
+ $url = "$'";
+#print STDERR "$url \n\n";
+ if ($url =~ "^\`") {
+ $url = substr($url, 1);
+#print STDERR "# $url \n";
+ $url = `$url`;
+#print STDERR "# $url \n";
+ }
push(@keys, $key);
- push(@tags, $1);
- push(@s, $');
+ push(@tags, $xtag);
+ push(@s, $url);
next unless $cache;
- next if $1 eq "FP" || $1 eq "PKG";
- system("eeshow-viewer", "-c", $') && push(@failed, $');
+ next if $xtag eq "FP" || $xtag eq "PKG";
+ system("eeshow-viewer", "-c", $url) && push(@failed, $url);
}
close MAP;
diff --git a/hw/getsilego b/hw/getsilego
new file mode 100755
index 0000000..d9c9612
--- /dev/null
+++ b/hw/getsilego
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo -n $(wget -q http://www.silego.com/softdoc/datasheet.html?filterPN=${1} -O -|sed -n "s%.*href\=\"\([^ ]*${1}[^ ]*pdf\)\".*%\1%;T;p;q" )