Jump to content

Conky And The Bangkok Post


bentrein

Recommended Posts

Is there anyone here who uses Conky?

I've recently started using it on Fedora 11, 64 bit. It works fine, except for the rss-reader script. I've added this to the bottom of my conkyrc

${color }Bangkok Post headlines
${color #707070}${hr}${color white}
${execi 300 /home/bentrein/.conkyrss.sh}

And now that .conkyrss.sh looks like this - I nicked this off the Conky-wiki.

URI=http://www.bangkokpost.com/rss/data/breakingnews.xml #URI of RSS Feed
LINES=10 #Number of headlines

#Environment Setup
EXEC="/usr/bin/curl -s" #Path to curl

#Work Start
$EXEC $URI | grep title |\
sed -e :a -e 's/<[^>]*>//g;/</N' |\
sed -e 's/[ \t]*//' |\
sed -e 's/\(.*\)/ \1/' |\
sed -e 's/\.//' |\
sed -e 's/\"//' |\
sed -e 's/\"//' |\
head -n $(($LINES + 2)) |\
tail -n $(($LINES))

The headlines however don't show up on my desktop. The text Bangkok Post headlines does... :) Can someone tell me what I'm doing wrong? It might very well be a problem with the bit under #Work Start, as I honestly don't have a clue what that does.

Link to comment
Share on other sites

My guess would be that your

URI=http://www.bangkokpost.com/rss/data/breakingnews.xml #URI of RSS Feed
LINES=10 #Number of headlines

#Environment Setup
EXEC="/usr/bin/curl -s" #Path to curl

should actually be

#URI of RSS Feed
URI=http://www.bangkokpost.com/rss/data/breakingnews.xml

#Number of headlines
LINES=10

#Environment Setup

#Path to curl
EXEC="/usr/bin/curl -s"

That's the first thing that stands out. Also, do you want the "Bangkok Post headlines" displayed in grey? And then switch to white (which isn't closed out apparently) for the headlines?

If that's true, this is probably more in line with what you want:

${color }Bangkok Post headlines
${color #707070}${hr}${color}
${execi 300 /home/bentrein/.conkyrss.sh}
${color #FFFFFF}

If you want them all the same colour, substitute the #FFFFFF for #707070. I could be all wrong with the code up top, but in normal code, the commented out section (signified with a "#" symbol) precedes the actual code. You may want to check and see if you have curl installed (would be an elementary mistake, but I make them on an hourly basis).

Another thing I thought of; try doing my fix and running the output of conky to a text file if the headlines still don't show up.

cd ~ && ./conky.sh | ~/Desktop/rss.txt

Navigate to your Desktop and open the rss.txt file and see if ANY headlines are in there.

Edited by dave_boo
Link to comment
Share on other sites

My guess would be that your <code sinp>

should actually be <code snip>. That's the first thing that stands out.

Thanks, but it didn't help. I'm new to this kind of coding, and I don't want to sound condescending by any means, but it didn't surprise me very much, as I've been told that anything after # won't be displayed or considered; no matter where where it's put. So all that happened is that my code now looks more common and prettier. Still no headlines.

As for the coloring advice, thanks. I'll take that into consideration once I actually get headlines. :)

And lastly...

cd ~ && ./conky.sh | ~/Desktop/rss.txt

Maybe it has something to do with the fact that my computer can't find a conky.sh anywhere... But then it wouldn't work at all, would it? This command also won't create a rss.txt on my desktop; it either says 'no such file', or (after I created the file) 'permission denied'.

It may have something to do with the fact that I'm not using Ubuntu, but Fedora 11. Perhaps? I don't know...

Link to comment
Share on other sites

Shouldn't

EXEC=foobar

be

$EXEC=foobar

at the beginning if you are setting up variables and the $sign removed under the #Work Start section?

(Disclaimer: I have very limited scripting capabilities)

as I've been told that anything after # won't be displayed or considered;

Anything after a hash (#) sign won't be noticed until whatever is parsing the file comes across the next carriage return symbol IIRC.

Link to comment
Share on other sites

Anything after a hash (#) sign won't be noticed until whatever is parsing the file comes across the next carriage return symbol IIRC.

You know more about coding than I do! :) I added the $ in front of EXEC, and there's a small change: there's a larger empty space at the bottom now, so something is working. But still no headlines showing. I saw somewhere else on the web that conky doesn't work with rss's that end in .xml, for some reason. Thanks for the help; I'll try to bug their forum more on it. If I can find a conky-specific forum. Later!

Link to comment
Share on other sites

And now that .conkyrss.sh looks like this - I nicked this off the Conky-wiki.

URI=http://www.bangkokpost.com/rss/data/breakingnews.xml

Assuming that URI is correct, try it in quotes as shown here:

URI="http://www.bangkokpost.com/rss/data/breakingnews.xml"

Link to comment
Share on other sites

Assuming that URI is correct, try it in quotes as shown here:

URI="http://www.bangkokpost.com/rss/data/breakingnews.xml"

The URI is what the Bangkok Post gives, and works when you subscribe with Opera's rss-reader. But this didn't help - much. Now there's more space under the title, but no headlines. Too bad. I still think it's got something to do with the xml extention. Somehwere on the web it says that is a problem. :)

Link to comment
Share on other sites

  • 2 months later...

Anyway, I've finally managed to get it to work, and here's a short how-to, for those interested in the Bangkok Post on their desktops. Two versions, a quick one, for experienced users, and a lengthy one, in case you still have trouble.

1) Quick guide:

Add (at least) the following code to your conkyrc file, assuming your conkyrc is in your home folder, and not in a sub folder:

${execi 300 /home/youruser/.conky-rss.sh http://www.bangkokpost.com/rss/data/breakingnews.xml 5 3}

Now download and save this tarball to your desktop. Unpack it, and put the conky-rss.sh into your home folder. Now rename it to .conky-rss.sh (spot the difference!). Now chmod 744 this .conky-rss.sh

Restart Conky.

2) Long guide:

Install Conky, code as above or:

su -
[i]password[/i]
yum -y install conky

Download and save this tarball to your desktop, and unpack it.

Delete your current .conkyrc from your home folder (to do this, open your home folder in e.g. Nautilus, choose View -> Show hidden files and folders, and you'll find .conkyrc somewhere in the list; select, and press delete).

Now copy the files you've just unpacked into your home folder (drag and drop from the desktop into the still open nautilus window). Select each file individually, press F2, and Home, and . (this renames the files into .conkyrc and .conky-rss.sh respectively).

Open .conkyrc with gedit.

Under the heading "Bangkok Post Headlines", change the word 'youruser' into whatever your username on your computer is.

Under the heading "Email" change the word 'Account 1' and/or 'Account 2' into nicknames for the accounts respectively, and in the string after that, change 'mailserver' into the mailserver of your IMAP account, login into your login name on that server, and password with your password. This will show how many emails there are in your inbox; you can also just remove that text altogether (from "${color white}Email:" to "-i 1000}").

Save and close.

Open a terminal.

su -
[i]password[/i]
chmod 744 /home/[i]youruser[/i]/.conky-rss.sh
exit

And close the terminal.

Now (re) start conky (ALT+F2 and type 'conky'.

And before I forget, here's my screenshot.

Edited by bentrein
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.





×
×
  • Create New...