Merge lp:~nhandler/origami/parseFAHStats into lp:origami

Proposed by Nathan Handler
Status: Merged
Approved by: Christer Edwards
Approved revision: 50
Merge reported by: Nathan Handler
Merged at revision: not available
Proposed branch: lp:~nhandler/origami/parseFAHStats
Merge into: lp:origami
Diff against target: 30 lines
1 file modified
origami (+20/-0)
To merge this branch: bzr merge lp:~nhandler/origami/parseFAHStats
Reviewer Review Type Date Requested Status
Christer Edwards Approve
Review via email: mp+13906@code.launchpad.net

Commit message

Modify 'origami status' to display some of the user's stats from kakaostats.com

To post a comment you must log in.
Revision history for this message
Nathan Handler (nhandler) wrote :

You can see the output of the script by running 'origami status'. 'origami install' might need to be updated to install the parseFAHStats script.

lp:~nhandler/origami/parseFAHStats updated
50. By Nathan Handler

Convert parseFAHStats script to use sed/wget instead of Perl and include inside of origami

Revision history for this message
Christer Edwards (christer.edwards) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'origami'
2--- origami 2009-10-24 20:50:40 +0000
3+++ origami 2009-11-05 02:59:09 +0000
4@@ -729,6 +729,26 @@
5 echo
6 echo "Team and User ranking URL:"
7 echo "http://kakaostats.com/t.php?filter=active&col=2&t="${ORIGAMITEAM}"&search_text="${ORIGAMIUSER}""
8+ url="http://kakaostats.com/t.php?filter=active&col=2&t=${ORIGAMITEAM}&search_text=${ORIGAMIUSER}";
9+ wget --quiet -O Stats $url
10+ sed -in ':a;N;$!ba;s/\n//g' Stats
11+ sed -in 's/.*<tr class="ls">//' Stats
12+ sed -in 's/<\/td><\/tr>.*$//' Stats
13+ sed -in 's/.*<\/a><\/td><td>//' Stats
14+ sed -in 's/<\/td><td class="g">/\n/' Stats
15+ sed -in 's/<\/td><td class="g">/\n/' Stats
16+ sed -in 's/<\/td><td class="g">/\n/' Stats
17+ sed -in 's/<\/td><td>.*//' Stats
18+ current=$(head -n1 Stats)
19+ day=$(head -n2 Stats | tail -n1)
20+ week=$(head -n3 Stats | tail -n1)
21+ month=$(tail -n1 Stats)
22+ echo -n "Current: ${current} "
23+ echo -n "In 24 Hs: ${day} "
24+ echo -n "In 7 days: ${week} "
25+ echo "In 30 days: ${month}"
26+ rm Stats &>/dev/null
27+ rm Statsn &>/dev/null
28 # we delete the file after we've reported the results so the next time we monitor
29 # we've started fresh
30 rm /tmp/origami-status &>/dev/null

Subscribers

People subscribed via source and target branches

to all changes: