1

Accessing RunningAHEAD Content from Another Web-Site (Read 775 times)

va


    Hi Eric: I have found, by looking at other people's sites that I can include something like this: <script></script> in my web site, and get my running totals. Are all of the available scripts documented in a post somewhere? Also, how can I reference a particular advanced graph from another web site? Thanks
      The available scripts are located in your training log's tools tab. There should be sufficient directions there for you to get started. If you are able to dig up someone else's script link in their blog, you'll have no problems. You can probably display the graphs too if you dig into the HTML source. You will not receive any official support for it right now. When I revamp the graphing, I will create similar URLs for them.
      va


        Thanks Eric, I figured out how to do the graphs!
          Thanks Eric, I figured out how to do the graphs!
          Can you explain how you did it? I'd like to experiment with it.
          Derek
          va


            What I did was create an advanced graph and then view the HTML source. I then cut and past the HTML surrounding the "img src="/graph.aspx" code (the encompassingHTML table) and put it in one of my web pages. This worked the first time. I don't really understand how this works, for it wasn't obvious how I was identified as the user in this snippet (whose data should be graphed by the graph.aspx code?). I was wondering if it was depending on some kind of cookie placed on my computer to identify the user. I tried a few experiments. I logged out of RA, and was able to still see the graph on my web. I then rebooted, and then when my compute was back up, I didn't log into RA, and I couldn't see the graph on my web. I then logged into RA, and still couldn't see it on my web. I cut and pasted the same snippet into my web, thinking it my contains some "dynamic" state information, but now, it still does not work. So now I can't get it to work, as it was last night. This goes beyond what I currently understand about web stuff.
              After looking at the graphing URL, I realized that the switch to search engine safe URLs prevents you from linking to the graphs. I'll change the graph URLs such that you can use them on your site. This will take a week or two though, because it's not an emergency, and it wasn't on my schedule.
              va


                Hi Eric: Thanks. It's not urgent. Btw, now for some reason it started working again. Confused Can you explain why it works sometimes and not others? If you go to my site, do you see the graph?
                  In order to answer the question, I need to give a little background on how web servers work. When you connect to a web server, it creates a session id that contains information to uniquely identify the instance of your browser. The server keeps this information around, and destroys it if you don't fetch another page from the server after a set amount of time (typically 10 to 20 minutes). The server does this because it doesn't know if you closed the browser or went to another site. It only knows if you're still on the site if you open another page. When you logging to RunningAHEAD, the server associates your login info with the session id. Since this id is unique to that instance of browser, every time the server sees that id, it knows it's you. If you then go over to your site using the same browser, your site tells your browser to fetch the graph from my server. Since the session id is still valid, my server knows who you are, and sends you the graph you are requesting. If you open a new copy of the browser then go to your site and you're logged out of my server, my server will not know who you are and therefore cannot create the graph. When I add your user id to the graph's URL, you will be able to use that link on your site.
                  va


                    Eric, thanks for the explanation. I understand. Cool stuff.
                      When you logging to RunningAHEAD, the server associates your login info with the session id. Since this id is unique to that instance of browser, every time the server sees that id, it knows it's you. If you then go over to your site using the same browser, your site tells your browser to fetch the graph from my server. Since the session id is still valid, my server knows who you are, and sends you the graph you are requesting.
                      And that explains why I see my workout graph when I visit va123's webpage. Smile
                      How To Run a Marathon: Step 1 - start running. There is no Step 2.