1

WordPress friendly stats scripts (Read 987 times)

    I am starting a blog hosted on Wordpress.com and unfortunately they don't allow javascript so the current RA running stats scripts don't work. Plain HTML versions would be very nice. I can only think of linking directly to a particular workout or my log summary page, but that's nowhere near as cool as having your latest workouts and mileage etc automatically updated on your blog. In the meantime if anyone has found a workaround for this, please let me know. Smile
    eric :)


      MajaRun, The trouble with plain HTML versions is that they don't update automatically. The whole point about these scripts is that they update your stats when they change. Do you know if Wordpress allows IFrames? If they do, I can probably get plain HTML versions working that would do auto updating as well. Let me know. eric Smile
        Thanks for the reply Eric! I didn't realize HTML can't really 'pull' fresh data like Javascript can. Unfortunately, after a quick search of the Wordpress forums, it looks like IFrames are also a no-no for security reasons. They are just super-cautious about any potential avenues which could bring down the whole Wordpress community with one malicious applet. If you have your own web host then the risk is only to your own blog, so I guess I'll have to settle for linking to my RA log etc. until I decide to shell out for my own site hosting. Blogger seems to be a little more footloose and fancy free with the javascript, but they have their own drawbacks too.
        Jim Melton


          I've actually asked the same question on the Runner's World forum (powered by Running Ahead Wink ). I actually have my own web host, so I can do JScript. The current scripts really are kind of rudimentary compared to what I was looking for. Would it be possible to get some more robust and/or customizable scripts? Jim
          Ed4


          Barefoot and happy

            Instead of an iframe you could use an image. Less flexible, but it would get past the security restrictions. But rather than try to satisfy everyone's need to integrate their data into other applications, why not expose a web service API for accessing the data? Then the rest of us could actually help implementing some of these things. If you restrict it to log data that's already public, it could be dead simple.
            Curious about running barefoot? Visit the new barefoot running group.
              Instead of an iframe you could use an image. Less flexible, but it would get past the security restrictions.
              Funny you should mention that. I gave this some thought too, but as crazy as it sounds there is no way to upload an image to Wordpress and have it appear in a sidebar. If you've got images on Flickr or hosted somewhere else, it's easy to pull off by linking to it - but the "upload image" function on Wordpress is only available when creating either a page or a post. I guess this all just points to the idea that I need to (eventually) get my free blog off the Wordpress server and pay to host it myself.
              derek


                If Eric used an image, there would be no need for you to actually "upload" it. You would simply hot link to the image. Whenever your blog is displayed, the image would be pulled directly from RA which would create it on-the-fly with the current stats. The only problem with this is that when browsers download it, they would cache the image so I don't know how well that would work. Eric would have to ensure he sets the appropriate HTTP headers to tell browsers not to cache the image.

                Derek

                  If Eric used an image, there would be no need for you to actually "upload" it. You would simply hot link to the image. Whenever your blog is displayed, the image would be pulled directly from RA which would create it on-the-fly with the current stats. The only problem with this is that when browsers download it, they would cache the image so I don't know how well that would work. Eric would have to ensure he sets the appropriate HTTP headers to tell browsers not to cache the image.
                  Ah, I see. That would be great - although it sounds like it shifts some cpu cycles and bandwidth back to RA. I suppose it wouldn't be too much of a burden if it was an option that was only enabled for those who have a blog and want to link to the image. That would be interesting to know how many of us there are. 10% of RA users? 20%?
                  Jim Melton


                    Here is what embedding the scripts in Wordpress looks like... http://themeltons.net/run-log/ I supposed I could spruce it up with some CSS, but these scripts aren't very flexible or robust in and of themselves. I keep meaning to look in my temp files for the JScript to see if I could find the calls to the database they make and then maybe try to make the same calls with PHP...haven't had the motivation to do that yet. I would really like to see a plugin developed that would allow me to manage and display my run log from my website. I believe it would actually be a nice advertising opportunity as well; there could be a tag, "Powered by Running Ahead" somewhere in the plugin.
                    eric :)


                      Jim, The scripts simply fetches HTML from the server. I suppose you can spruce them up by parsing the HTML and extracting its contents, but that's probably more work than its worth. These are the scripts that folks wanted. If you need other ones, let me know and I'll add them. eric Smile