Browse code

action workflow superlinter

dewomser authored on27/06/2020 03:00:44
Showing1 changed files
... ...
@@ -5,7 +5,6 @@ xmlgetnext () {
5 5
    local IFS='>'
6 6
    read -d '<' TAG VALUE
7 7
 }
8
-
9 8
 cat "$1" | while xmlgetnext ; do
10 9
    case $TAG in
11 10
       'item')
... ...
@@ -56,7 +55,7 @@ EOF
56 55
 
57 56
 if [ $enclosure -eq 1 ] ; then
58 57
 
59
-cat "$1" | egrep enclosure | sed -n "$zaehl"p | sed -e 's/<enclosure//g' -e 's/<\/item>//g' -e 's/length=\"0\"\///g' -e 's/type=\"image\/jpeg\" url/<img src/g'
58
+cat "$1" | grep enclosure | sed -n "$zaehl"p | sed -e 's/<enclosure//g' -e 's/<\/item>//g' -e 's/length=\"0\"\///g' -e 's/type=\"image\/jpeg\" url/<img src/g'
60 59
 zaehl=$((zaehl+1))
61 60
 
62 61
 fi
Browse code

erster commit

dewomser authored on27/06/2020 01:16:11
Showing1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,70 @@
1
+#!/bin/bash
2
+zaehl=1
3
+
4
+xmlgetnext () {
5
+   local IFS='>'
6
+   read -d '<' TAG VALUE
7
+}
8
+
9
+cat "$1" | while xmlgetnext ; do
10
+   case $TAG in
11
+      'item')
12
+         title=''
13
+         link=''
14
+         pubDate=''
15
+         description=''
16
+         enclosure=''
17
+         
18
+         ;;
19
+      'title')
20
+         title="$VALUE"
21
+         ;;
22
+      'link')
23
+         #link="$VALUE"
24
+         link="$VALUE" 
25
+         #link=$( ./WZ.sh "$VALUE"
26
+         ;;
27
+      'pubDate')
28
+         # convert pubDate format for <time datetime="">
29
+         datetime=$( date --date "$VALUE" --iso-8601=minutes )
30
+         pubDate=$( date --date "$VALUE" '+%d.%m %Y  %H:%M%P Uhr' )
31
+         ;;
32
+      'description')
33
+         # convert '&lt;' and '&gt;' to '<' and '>'
34
+         description=$( echo "$VALUE" | sed -e 's/&lt;/</g' -e 's/&gt;/>/g' )
35
+         enclosure=0
36
+
37
+        ;;
38
+        
39
+          enclosure*)  
40
+          enclosure=1
41
+         
42
+         ;;
43
+      
44
+  '/item')
45
+      
46
+    
47
+         cat<<EOF
48
+<article>
49
+<h3><a href="$link">$title</a></h3>
50
+<p>$description
51
+<span class="post-date">hoch geladen am <time
52
+datetime="$datetime">$pubDate</time></span></p>
53
+<p></p>
54
+</article>
55
+EOF
56
+
57
+if [ $enclosure -eq 1 ] ; then
58
+
59
+cat "$1" | egrep enclosure | sed -n "$zaehl"p | sed -e 's/<enclosure//g' -e 's/<\/item>//g' -e 's/length=\"0\"\///g' -e 's/type=\"image\/jpeg\" url/<img src/g'
60
+zaehl=$((zaehl+1))
61
+
62
+fi
63
+
64
+  ;;
65
+      esac
66
+    
67
+done
68
+
69
+sleep 2
70
+