Website hit counter

Any idea how to use the agent to get the number of page views from a website?

I built a YouTube viewcounter but the YouTube API only updates every 24 hours so it’s not very responsive.

I thoughtI would modify the Agent code to show website hits, Facebook likes or Twitter follwers.

Any advice?



If you can find an API for any website applications, you can use the Imp agent.
Look for those with Facebook/Twitter and provide us with the API you find.

The only difference in the code is how to parse the API responses.

Yup, the Twitter API seems tricky to use. I found that some people are using Yahoo YQL to ease the pain.

I’m also finding hard to figure out how to do a simple website counter.

My web knowledge is minimal as you can probably guess from my post.

Any help would be most appreciated.

I would consider the term ‘website counter’ to be a website, not twitter or facebook. The methods would be totally different.

Website counters themselves have issues … whether it is site refreshes, unique visits, hot linking, search robots, … what is considered a “visit”? What does your ‘count’ represent?

The counter will actually show Twitter, Facebook and website info.

Facebook is easy to scrape but Twitter and Google Analytics are trickier for me.


Google Analytics is really advanced. Here is the PHP documentation:

You would have to create a PHP script to get the data you want, and the Imp agent calls your PHP script to get the info. Really a tough one to do.

We have code for interacting with the Twitter API - right now it can search, stream and tweet - but it shouldn’t be too difficult to extend it to look at the user’s profile.

I was hoping that I could pull real time data from Google Analytics using OAuth to authenticate but it seems trickier than that.