Not sure where this goes, so I'll put here under software.
I wrote a little app (ErgFeed) that will allow you to "erg tweet" your erg scores. Just send a tweet to @ergscores with DISTANCE TIME DATE(optional) comments(optional). (see http://twitter.com/ergscores)
TIME can be split or total time.
If you log into http://ergfeed.appspot.com (uses Google account) you can setup your C2 logbook profile and tweets will get posted to your logbook.
Just a small app that maybe some finds useful.
Erg Tweet -- post to C2 via Twitter
- Citroen
- SpamTeam
- Posts: 8054
- Joined: March 16th, 2006, 3:28 pm
- Location: A small cave in deepest darkest Basingstoke, UK
I've edited your post to fix the URLs (sorry about the restriction on new users not being able to post URLs - it's to stop spammers).
Rather than using ERGfeed to update your C2 logbook (I'm using the C2 Utility for that), how about using the C2 logbook to update ERGfeed and tweet the results?
I'd use http://concept2.com/sranking03/small_co ... ser=142454 as the data source (you'd have to store the data in a database so you can calculate the delta) and go round and poll all the registered users on a timer. That doesn't need the userid/password for the C2 logbook, it's a public URL used for the iGoogle widget (only needs a ranking ID).
Of course, what we really need from the nice folks in Vermont is a RESTful API for the C2 Logbook. That would let us play in Web 2.0 with all of the logbook stuff.
Rather than using ERGfeed to update your C2 logbook (I'm using the C2 Utility for that), how about using the C2 logbook to update ERGfeed and tweet the results?
I'd use http://concept2.com/sranking03/small_co ... ser=142454 as the data source (you'd have to store the data in a database so you can calculate the delta) and go round and poll all the registered users on a timer. That doesn't need the userid/password for the C2 logbook, it's a public URL used for the iGoogle widget (only needs a ranking ID).
Of course, what we really need from the nice folks in Vermont is a RESTful API for the C2 Logbook. That would let us play in Web 2.0 with all of the logbook stuff.
- Citroen
- SpamTeam
- Posts: 8054
- Joined: March 16th, 2006, 3:28 pm
- Location: A small cave in deepest darkest Basingstoke, UK
You can use:ToddMR wrote:Is there a way to add the information in the iGoogle C2 counter to my WordPress blog?
http://concept2.com/sranking03/small_co ... ser=142454<<< use your ranking ID here
as a raw datasource. It's not difficult to parse the HTML that's returned using something like HTML::TokeParser in Perl.
Use that as the source for any gadget or widget, if you're prepared to write some code round it. It'll work in a simple IFRAME.
Code: Select all
<iframe src ="http://concept2.com/sranking03/small_counter.asp?user=142454" width="100%" height="600px">
<p>Your browser does not support iframes.</p>
</iframe>
Is there a way to get just the text data from the
http://concept2.com/sranking03/small_co ... ser=142454<<< use your ranking ID here without the image?
I'd like to put the counter data into a sidebar text widget, but they're limited to 160px in width.
http://concept2.com/sranking03/small_co ... ser=142454<<< use your ranking ID here without the image?
I'd like to put the counter data into a sidebar text widget, but they're limited to 160px in width.
- Citroen
- SpamTeam
- Posts: 8054
- Joined: March 16th, 2006, 3:28 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Here's a bit of scruffy Perl code that will strip out the <TABLE></TABLE> with the main detail.ToddMR wrote:I'd like to put the counter data into a sidebar text widget, but they're limited to 160px in width.
Code: Select all
#! /usr/bin/perl
use strict;
use LWP::Simple;
use HTML::TokeParser;
use Switch;
my $url= 'http://concept2.com/sranking03/small_counter.asp?user=142454';
my $content = get $url;
die "Couldn't get $url" unless defined $content;
my $parse = HTML::TokeParser->new(\$content);
my $output = 0;
my ($tag, $attr, $attrseq, $rawtxt);
while (my $token = $parse->get_token)
{ my $ttype = shift @{$token};
my ($tag1, $tag2, $tag3, $tag4) = @{$token};
if ($ttype eq "S") {if ($tag1 eq "table") {$output = 1;}}
if ($ttype eq "E") {if ($tag1 eq "table") {print $tag2; $output = 0;}}
if ($output eq 1) { switch ($ttype) {
case "S" { print $tag4 }
case "T" { print $tag1 }
case "E" { print $tag2 }
else { print "\n" } } }
}