Added RSS Feed

This commit is contained in:
Akamaru 2016-03-15 14:46:38 +01:00
parent aa4efc2c0a
commit 51b3fd5dcf
3 changed files with 66 additions and 1 deletions

63
.conky/rss.pl Normal file
View File

@ -0,0 +1,63 @@
#!/usr/bin/perl -w
############################
# Creator: Jeff Israel // modified by Akamaru (https://PonyWave.de)
#
# Script: ./simple-rss-reader-v3.pl
# Version: 3.001
#
# Coded for for Wikihowto http://howto.wikia.com
#
# Description: This code downloads an RSS feed,
# extracts the <title> lines,
# cleans them up lines,
# prints the pretty lines
# exits on max-lines
# Usage:
# .conkyrc: ${execi [time] /path/to/script/simple-rss-reader-v3.pl}
#
# Usage Example
# ${execi 300 /path/to/script/simple-rss-reader-v3.pl}
#
use LWP::Simple;
############################
# Configs
#
#$rssPage = "http://tvrss.net/feed/combined/";
$rssPage = "http://yagyuu.local/rss/atom.xml";
$numLines = 5;
$maxTitleLenght = 55;
###########################
# Code
#
# Downloading RSS feed
my $pageCont = get($rssPage);
# Spliting the page to lines
@pageLines = split(/\n/,$pageCont);
# Parse each line, strip no-fun data, exit on max-lines
$numLines--; #correcting count for loop
$x = 0;
foreach $line (@pageLines) {
if($line =~ /\<title\>/){ # Is a good line?
#print "- $line\n";
$lineCat = $line;
$lineCat =~ s/.*\<title\>//;
$lineCat =~ s/\<\/title\>.*//;
$lineCat =~ s/\[.{4,25}\]$//; # strip no-fun data ( [from blaaa] )
$lineCat = substr($lineCat, 0, $maxTitleLenght);
print "- $lineCat \n";
$x++;
}
if($x > $numLines) {
last; #exit on max-lines
}
}

View File

@ -72,6 +72,8 @@ ${color2}Glurak${color1}(${fs_type /home/akamaru/Festplatten/Glurak/})${alignr}$
${color2}Karnimani${color1}(${fs_type /home/akamaru/Festplatten/Karnimani/})${alignr}${color3}${fs_size /home/akamaru/Festplatten/Karnimani/}>${color4}${fs_used /home/akamaru/Festplatten/Karnimani/}${color1}${alignr}${fs_bar 8,75 /home/akamaru/Festplatten/Karnimani/} ${color2}(${fs_used_perc /home/akamaru/Festplatten/Karnimani/}%)
${color2}Mautzi${color1}(${fs_type /home/akamaru/Festplatten/Karnimani/})${alignr}${color3}${fs_size /home/akamaru/Festplatten/Mautzi/}>${color4}${fs_used /home/akamaru/Festplatten/Mautzi/}${color1}${alignr}${fs_bar 8,75 /home/akamaru/Festplatten/Mautzi/} ${color2}(${fs_used_perc /home/akamaru/Festplatten/Mautzi/}%)
${color2}Pikachu${color1}(${fs_type /home/akamaru/Festplatten/Pikachu/})${alignr}${color3}${fs_size /home/akamaru/Festplatten/Pikachu/}>${color4}${fs_used /home/akamaru/Festplatten/Pikachu/}${color1}${alignr}${fs_bar 8,75 /home/akamaru/Festplatten/Pikachu/} ${color2}(${fs_used_perc /home/akamaru/Festplatten/Pikachu/}%)
${color0}RSS $hr:
${color2}${execi 1 /home/akamaru/.conky/rss.pl}
${color0}Netzwerk $hr:
${color4}WLAN${color2} ${alignr}${color2}IP ${addr wlan0}
${color2}Download ${downspeed wlan0}/s ${alignr} $alignr Upload ${upspeed wlan0}/s

View File

@ -5,4 +5,4 @@ My Naira Conky Theme
[Get conky](https://github.com/brndnmtthws/conky)
---------------------------------------------------
![http://img.akamaru.de/di/Y70K/TeamViewer_2016-03-10_23-22-00.png](http://img.akamaru.de/di/Y70K/TeamViewer_2016-03-10_23-22-00.png)
![http://img.akamaru.de/di/RU97/TeamViewer_2016-03-15_14-43-33.png](http://img.akamaru.de/di/RU97/TeamViewer_2016-03-15_14-43-33.png)