Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP: Display ebay bids on your desktop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
zigford
n00b
n00b


Joined: 16 Feb 2005
Posts: 2

PostPosted: Mon Jun 05, 2006 11:55 am    Post subject: TIP: Display ebay bids on your desktop Reply with quote

I have been away from gentoo for a while, but recently got peeved off with gnome/kde's massive memory footprints and slow crappiness.

I have moved back to the land of "simple is better" and am enjoying myself thouroughly.

Some things I have achieved with bash scripts:

1. Radio MP3 stream ripping (Through a cronjob)
2. CLI Podcast downloading
3. iPod (with Rockbox (rockbox.org) sync bash script. The script downloads cvs, compiles and installs latest rockbox code.
4. Display my ebay bids on the desktop.

The last one I will show you. Its not that complex, and my scripting could do with some cleanups and if you want to use it, you may need to modify it for your local country ebay. Its working for me in Oz.

Firstly I made a bash script that takes one input !Ebay Item Number!

Code:

#!/bin/bash

ITEM=$1
SITE="http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&item=${ITEM}&ru=http%3A%2F%2Fsearch.ebay.com.au%3A80%2Fsearch%2Fsearch.dll%3Ffrom%3DR40%26satitle%3D7246722770%26fvi%3D1"

lynx -dump "$SITE" > /tmp/$ITEM.txt

CURRENT_BID=$(cat /tmp/$ITEM.txt \
             |grep -m1 -e "Current bid" \
             |awk -F ' ' '{print$4}')
END_TIME=$(cat /tmp/$ITEM.txt |grep -m1 -e "End time"|sed 's/^ *//')
HIGH_BIDDER=$(cat /tmp/$ITEM.txt |grep -m1 -e "High bidder"|awk -F ']' '{print$2}'|awk -F '[' '{print$1}')

echo "Item: $ITEM"
echo "Current bid: $CURRENT_BID"
echo "$END_TIME"
echo "Highest bidder: $HIGH_BIDDER"


You can see above that I've just gone to ebay and ripped the link out of the web browser.
In that link I have replaced the Item number for the variable $ITEM

I thank use "lynx" to output the webpage into plain text. If someone knows sed/grep/awk well enough they could skip this step.

I then user grep/sed/awk to rip some variables and then output them to the screen how I want them.

I have then configured conky to display all of this.

The end result.
I was going to post a screenshot, but cannot find how. toodles[/url]
_________________
----------------------------------------
Say hi to your mum for me
Back to top
View user's profile Send private message
linux_girl
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 283

PostPosted: Sun Sep 24, 2006 3:04 pm    Post subject: Reply with quote

use wget to output in stdout and use pipes. to get my ip
Code:

wget -q -O - www.whatismyip.com |grep -i '<TITLE>'

or in ~/.bashrc
Code:

function ip {
    wget -q -O - www.whatismyip.com |grep -i '<TITLE>'
}

_________________
:D :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum