 |
~*Saber*~ [deleted] says:
o i love this..tis preddy sweet sexy
Posted 75 months ago.
(permalink)
|
|
Any chance of adding functionality to record individual photo and/or set pages, each of which record views separately?
Posted 75 months ago.
(permalink)
|
|
@Cyron - I would like to be able to bring this type of tracking to individual photos, but it would require a lot of overhead. For some reason the Flickr API doesn't report photo views directly, so you'd have to iterate through each page of the photostream and scrape the views from each page. This is feasible, but it would be slow. Another problem is the storage requirements for the view data. Daily view data for a large photostream with thousands of photos, across many days, would quickly become fairly large. Currently the data is stored using the Greasemonkey persistence API, which is designed for storing configuration settings and things like that - I'm not sure how it would respond to multiple megabytes of data.
Sets are a good idea, since the volume is much lower than for individual photos (for most users, anyway). You'd still have to go through each set individually, though, because again, the API for sets doesn't include view data.
You could also put together a system for tracking individual photos selectively, so you didn't have to look at the whole photostream - some kind of interface to select the photos you wanted to track, and a page displaying the view history for those photos.
Posted 75 months ago.
(permalink)
|
|
Can we have sparklines please :)
Posted 75 months ago.
(permalink)
|
|
@Tom - Sparklines are an excellent idea. The latest version (1.01, available here), adds sparkline support. Edit the CHART_TYPE configuration parameter at the top of the script to choose either the regular graph, as shown above, or the sparkline version, as shown here:

The sparkline data only shows the most recent 60 days, unlike the regular graph, which shows all data.
The sparkline images are provided by the excellent web service at BitWorking.org.
Posted 75 months ago.
(permalink)
|
|
Excellent, thanks!!
Posted 75 months ago.
(permalink)
|
|
The sparklines graph type introduced a display problem in the standard graph, which has now been fixed in the latest version (1.02). If you've been having display problems with the standard graph, please update the script to the current version.
Posted 75 months ago.
(permalink)
|
|
This was working great until tonight and suddenly the graph has vanished. Did something change on flickr, or am I the only one seeing the hiccup?
Posted 74 months ago.
(permalink)
|
|
doesn't working for me too.
might have something to do with this.
Posted 74 months ago.
(permalink)
|
|
Yeah, I'm assuming the regex is busted.
Posted 74 months ago.
(permalink)
|
|
Well, the matching works, it's something with the graph, because the sparkline works just fine still.
Posted 74 months ago.
(permalink)
|
|
the graph does show now for me.
Posted 74 months ago.
(permalink)
|
|
the graph works fine for me.
Posted 74 months ago.
(permalink)
|
|
It went away... it came back... possibly just evidence of Flickr tinkering under the hood...
Posted 74 months ago.
(permalink)
|
|
Very nice indeed. Thank you! :)
Posted 74 months ago.
(permalink)
|
|
Excellent!
Posted 74 months ago.
(permalink)
|
|
I hope you'll find a way to get this to work with the new Flickr interface - it was one of my favourite hacks and I miss it already!
Posted 73 months ago.
(permalink)
|
|
Anyone have this working in Gamma yet?
Posted 73 months ago.
(permalink)
|
|
I miss it too, I only had it installed a few days ago. Be lovely if it was fixed. :)
Posted 73 months ago.
(permalink)
|
|
Fix coming soon. Sorry for the problems with the redesign.
Posted 73 months ago.
(permalink)
|
|
the redesign is not your fault jpo....!
Posted 73 months ago.
(permalink)
|
|
I've got a less than perfect hack to this hack, but it will keep your counts going at the least. I haven't goten the sparkline to work, as it just shows up as an broken image. The following changes will make the graph appear at the bottom of your first page before the pagination. This is a tide-me-over for the addicted until the author can make an official update.
The changes are at the beginning of processTop() and there are no changes after the snippet.
I left the original lines in, but commented them out, so you can recognize the block of code to cut and paste over:
function processTop() {
// var list = xpath("//p[@style='font-size: 11px;']/b/parent::*");
var list = xpath("//small");
var views = 0;
var paragraph;
paragraph = list.snapshotItem(0);
var viewstr = String(paragraph.innerHTML);
while (viewstr.indexOf(' ') > 0)
{
viewstr = viewstr.substr(viewstr.indexOf(' ')+6);
}
viewstr = viewstr.substr(0,viewstr.indexOf(' '));
viewstr = viewstr.replace(/,/g,'');
views = Number(viewstr);
// for (var i = 0; i < list.snapshotLength; ++i) {
// paragraph = list.snapshotItem(i);
// var c = paragraph.firstChild;
// if (c == null) continue;
// if (c.nodeValue == null) continue;
// if (c.nodeValue.indexOf("Your photostream has been viewed") < 0) continue;
// var b = c.nextSibling;
// if (b == null) continue;
// var views = b.nodeValue * 1;
// c = b.firstChild;
// if (c == null) continue;
// views = c.nodeValue * 1;
// }
if (views <= 0) return;
var newLink = document.createElement("a");
newLink.href = "http://www.flickr.com/photos/jpoa/118364532/";
var newImage = document.createElement("img");
newImage.src = "";
newLink.appendChild(newImage);
var newSpan = document.createElement("span");
newSpan.id = "chartPlaceholder";
newSpan.appendChild(newLink);
newSpan.setAttribute("style", "display:none;");
var placeToPutChart = xpath("//div[@class='Pages']").snapshotItem(0);
if (CHART_TYPE == 1) {
// paragraph.parentNode.insertBefore(newSpan, paragraph);
placeToPutChart.insertBefore(newSpan, placeToPutChart.firstChild);
} else if (CHART_TYPE == 2) {
Posted 73 months ago.
(permalink)
|
|
Of course, YMMV, and no guarantees that it works for everyone, as this is just a quickie patch.
Posted 73 months ago.
(permalink)
|
|
Works for me - thanks DoubleGrande!
Looking forward to jpo's "official" update...
Posted 73 months ago.
(permalink)
|
|
works for me as well, well done, thanks a lot DoubleGrande!
Posted 73 months ago.
(permalink)
|
|
I added that bit of blurb in the right place and now it works!
However it starts yesterday when I apparently had only one view... probably it doesn't show old data but started counting the moment i installed it?
edit: yes it must be .. today is only 1 hour young and went up to a whopping 10 views already!
Originally posted 73 months ago.
(permalink)
عʈ¡ - ʇıɯʃ ıʇӡ ʞıɹӡ edited this topic 73 months ago.
|
|
OK, the script has been updated to cope with the Flickr redesign. The new script (version 1.05) is available here. Please check it out and let me know if you have any trouble.
Thanks to DoubleGrande for the temporary fix, which is quite similar to mine. If you're already using the temporary fix, you can continue to use it, or upgrade to the official version 1.05.
Is anyone else experiencing the counting reset reported by eti?
Posted 73 months ago.
(permalink)
|
|
wow jpo, the sparkline chart looks pretty damn classy up there in the new redesign.
Posted 73 months ago.
(permalink)
|
|
no reset here, but the pink graph is HUGE and knocks everything down at least 100 pixels
the sparkline location is great, but if you continue with the pink graph, it could be moved to the top of the cell containing the sets
Originally posted 73 months ago.
(permalink)
InsaneNinja [at] gmail.com edited this topic 73 months ago.
|
|
Thanks jpo! If there was a way to implement InsaneNinja's suggestion it would be even better...
Posted 73 months ago.
(permalink)
|
|
I will install the official version tonight and see if the counter reset is still happening... not that it would bother me all that much of course
Posted 73 months ago.
(permalink)
|
|
My counter wasn't reset.
Posted 73 months ago.
(permalink)
|
|
My counter is fine, the graph is way too big in the current location, the sparkline is gret though maybe a tiny bit small??
Posted 73 months ago.
(permalink)
|
|
an idea of a way to do it would be to just have the small sparklines graph on display at first, and if its clicked, it could popup the big graph version in a floating div, like the way CK has made the toggle recent comments popup flickr.com/photos/ckyuan/148597864/
Originally posted 73 months ago.
(permalink)
steeev (a group admin) edited this topic 73 months ago.
|
|
Yes, that's a great idea!
Posted 73 months ago.
(permalink)
|
|
worked briefly but seems broken again.
using Mac OSX 10.3.9 and firefox 1.5.0.3
Posted 73 months ago.
(permalink)
|
|
ive made a temporary fix for the script available here: steeev.f2o.org/flickr/flickrphotostreamgraphr.user.js
until the author makes an official fix available
Originally posted 73 months ago.
(permalink)
steeev (a group admin) edited this topic 73 months ago.
|
|
That's better- cheers steeev!
Posted 73 months ago.
(permalink)
|
|
Hmm, I think one of the flickr devs hates this hack, because now they have apparently masked the text with a spaceball image. WTF?
Posted 73 months ago.
(permalink)
|
|
What do you mean DoubleGrande?
My graph vanished earlier today but then I installed it again and now I can see it
Posted 73 months ago.
(permalink)
|
|
When I do view source on the page the views are no longer in the source code it has the little image they use to block the main photos from easy right-click downloading, so I'm not sure how the script can access the viewcount unless it's guaranteed to run after the flickr script.
Posted 73 months ago.
(permalink)
|
|
The views are in the source code. There is a spaceball.gif as well, but it's 1 pixel high and used as a spacer...
Posted 73 months ago.
(permalink)
|
|
Very odd. Earlier I didn't see the view text. When I saw your response I verified that I was still getting no graph, and that the source looked normal (with the trailing spaceball as you say). Refresh, no graph. Then I thought maybe since I installed Firebug that was it. I disabled it and restarted FF, and the graph was back. I re-enabled Firebug and restarted FF, and I still have the graph, so not sure what's up.
Posted 73 months ago.
(permalink)
|
|
The standard graph doesn't seem to be working anymore - I'm just getting a broken graphic icon. The sparkline option still seems to be functional...
Is the standard graph dependent on an externally hosted file?
Posted 73 months ago.
(permalink)
|
|
Yes the graph is located on something like myjavaserver.com
It works fine on my puter.
Posted 73 months ago.
(permalink)
|
|
I think that's what made it die for a few hours a few weeks ago.
Posted 73 months ago.
(permalink)
|
|
Thanks to everyone for your comments and feedback. The graphing script has been periodically broken over the last couple weeks due to Flickr tinkering with the site design, and problems with the system that generates the graphs (as eti noted, the graphs are not generated by Flickr, but by another server located offsite).
I've now updated the script (version 1.06) to handle the latest Flickr design changes, and to add a couple new features. It is working properly on the Flickr Gamma site as of May 23, 2006.
The new features include the following:
- Place the graph in the Sets section rather than as part of the top line. This makes it take up less space on the screen. The graph is placed above the Sets by default, but you can change it to place it below the Sets by changing the configuration parameter CHART_LOCATION in the script. Sparklines are still displayed right in the top section before the number of views, but they should be formatted better now.
- Control the colors used to display the graph, by changing the CHART_FILL_COLOR and CHART_OUTLINE_COLOR parameters. If you don't like the big pink chart, you can now change it.
The new script is available here. Please let me know if you have any problems.
Posted 73 months ago.
(permalink)
|
|
Thanks a bunch. Neat new options too. Though the pink and blue has grown on me.
Posted 73 months ago.
(permalink)
|
|
Very odd. It seems to think I've had -100 views today.
Posted 73 months ago.
(permalink)
|
|
I can't seem to get this link getting a page can't be displayed.
Posted 73 months ago.
(permalink)
|
|
I'm getting a 500 - Internal Server Error
The server must be down. Will try later on.
Posted 73 months ago.
(permalink)
|
|
Its still dead...
Posted 73 months ago.
(permalink)
|
|
yes, userscripts.com is not that reliable ...
i'll host it till jpo comes up with a solution
netomer.de/data/tmp/flickrphotostreamgraphr.user.js
Posted 73 months ago.
(permalink)
|
|
This feature, I tried for 1.5. Today it don't work & I cannot sign into flickr account for 6 hours.
Now the graph don't work. Any solution??
I appreciate it...
Posted 73 months ago.
(permalink)
|
|
All fucked up...
Posted 73 months ago.
(permalink)
|
|
hmmm ... graph and sparkline are fine for me.
Originally posted 73 months ago.
(permalink)
Nils Windisch edited this topic 73 months ago.
|
|
It's randomness. I was at -100 for a day, but it righted itself.
Posted 73 months ago.
(permalink)
|
|
It now seems to be terminally fucked - I'm getting the minus views and none of the "history" (I'm assuming my accumulated data has been lost or scrambled too). It doesn't work in squiggly line mode either :(
Is another update on the horizon or is it just too much of a chore to maintain?
[Edit - now I'm just getting a generic graphic icon whilst the browser tries in vain to contact the off-site source...]
Originally posted 73 months ago.
(permalink)
Mr Jaded edited this topic 73 months ago.
|
|
@MrJaded, have you tried to go into about:config and remove the data stored?
I think the name is:
greasemonkey.scriptvals.http://flickr.photostreamgraphr.com/Flickr Photostream Graphr
(you might have to remove more than one key and then restart Firefox)
I say that because the graph works fine for me.
Originally posted 73 months ago.
(permalink)
mortimer? edited this topic 73 months ago.
|
|
I'm still getting an OK graph. It doesn't show up all the time, but looks OK when it does. The only strange thing was, I was offline for a few days and instead of a zero entry for those days with a spike(on the last day) covering the past missing days traffic, my spike covered all the missing days also. But since that's good for my ego, I'm not complaining :-)
Posted 73 months ago.
(permalink)
|
|
I'm going to uninstall it - unfortunately it only displays nonsense, views can be anything between minus 10.000 and plus 10.000 according to the graph
Posted 73 months ago.
(permalink)
|
|
Is there an upper limit on views the graph displays? Mine topped out the 300 mark the last day or two and doesn't seem to be altering the graph to display the data more effectively.
/me sad, i love that little script.
but otherwise great work.
Posted 73 months ago.
(permalink)
|
|
To all those having problems with negative views, some notes on the causes and fixes for this.
First of all, the way the script works is that each time you access your photostream page, it records the current view count and saves it in a special set of Greasemonkey configuration variables. The view count is saved once per day at most.
There are two possible ways for this data to get corrupted, and I'll detail the fixes for these below. The first way is the the general Flickr weirdness during the Gamma site redesign over the last few weeks. The script needs to locate and parse the number which represents the current view count, and Flickr has slightly changed the location and syntax of this element a couple times recently. In most cases this should just cause the graph to not display at all, but in some cases the underlying data might be corrupted. This is easy to fix on your side (the data is in your browser), and I'll describe how below.
The second way the data can get screwed up is if you're using multiple Flickr userids on the same computer. Let's say you have user A with 5,000 views, and user B with 7,000 views. User A accesses the system today, and the script records the current view count of 5,000. User B accesses the system tomorrow, and the script then records 7,000 views, which makes it think that you had +2,000 views today. Then if user A comes back the next day, the script records 5,000 views, and this looks like -2,000 views for the day.
There are two fixes for this, both on my side. First, the script has now been updated to support multiple users. The script stores data separately for each Flickr userid, so in the scenario above, User A and User B will see two completely different graphs, with no co-mingling of their data. Second, I've updated the graphing code so that it will never show negative numbers, even if your data has been corrupted in the past from the Flickr Gamma redesign or multiple users sharing your machine. Both these fixes are in place now, in version 1.07 of the script, available here.
I'll describe the fix for existing corrupted data in a separate post below, because this one is getting ridiculously long...
Posted 73 months ago.
(permalink)
|
|
Following up on my previous post, here is how to clean up your existing data if you're having problems with corrupted data. In a new Firefox window or tab, type "about:config" (without the quotes) in the address bar. This will bring up a screen with Firefox configuration settings that looks like this:

In the "Filter" field, type "graphr" (without the quotes, and no 'e' between the 'h' and the 'r'). This will filter the settings down to just a few values, like this:

The setting that is called "firstMonth" stores the first month you started using the script (YYYY-MM). This value is probably OK and you don't need to touch it. The other values, one per month, store the actual daily view data. This is the data that you need to clean up if you are having display problems with your graph. The values are simply view counts, 31 per month, separated by commas. For days with no view counts (if you didn't access Flickr that day - it happens to some of us occasionally), there is no value, just repeated commas.
To edit the values, double-click one of the rows, and an edit window will pop up. In this window, you can carefully edit the data, changing any values that look wrong, or deleting them altogether. You can change or delete any of the numbers - but do not add or delete any commas.
If you're feeling insecure or unappreciated on Flickr, you can even make up your own numbers to give yourself a nice healthy graph :-)
Note that if your data is badly messed up and you just want to start over, you can simply uninstall and reinstall the script, by right-clicking on the little Greasemonkey icon in the lower right corner and selecting "Manage User Scripts". Be sure to select the option to "Also uninstall associated preferences" when uninstalling, which causes it to remove all the existing data for the script. Then you can reinstall the script and start from scratch.
Good luck and thanks for your interest in this script.
Posted 73 months ago.
(permalink)
|
|
@MacRonin47: The behavior you're describing when offline is by design. Let's say you have 1,000 views on June 1, and then you are offline until June 5, at which point you have 1,400 views. Rather than showing zero for the days in between and showing 400 views for June 5, the script assumes that the views were evenly spread over the intervening days (which is the most reasonable assumption in most cases). So in this case, it would display June 2, 3, 4, and 5 each with 100 views, which I think is what you would probably expect to see.
The recommended way to work around this behavior, of course, is simply to use Flickr every day.
Posted 73 months ago.
(permalink)
|
|
@clickykbd: The graph automatically sets the vertical scale to accomodate the largest value on the graph. So if you have a huge spike on one day, it may cause a loss of vertical resolution for the rest of the data on the graph. There is no way to control the vertical scale directly, but you have a couple options if you want to play around with the data using the techniques I described above.
First of all, you can set the "firstMonth" configuration option to another value. If your spike was in May, you could set the firstMonth value to "2006-06", which would cause the graph to ignore the May data and only show the values from June.
Secondly, you could manipulate the data values themselves. If you've got an abnormal spike that you want to get rid of, you could spread the data over several days to reduce the size of the spike. If, for instance you're normally getting 10 views per day, but on one day you happened to get 1000 views, your data might look like this (remember, the script records the total number of views, not the number of views per day):
4100,4110,4120,4130,5130,5140,5150,5150,5160
To smooth out the big spike, you could change this to:
4100,4300,4400,4600,4700,4800,5000,5100,5160
This would spread the data out, giving you a lower and wider spike, and give you more vertical resolution in the graph.
Posted 73 months ago.
(permalink)
|
|
Thanks jpo - having another flickr user access their account on my machine was the route of my problems. Although I had uninstalled it (and its preferences) I had backed up the data and managed to manually restore it.
Thank again for mending my favourite greasemonkey script.
Posted 73 months ago.
(permalink)
|
|
thanks... will try mucking with the data and parameters.
Posted 73 months ago.
(permalink)
|
|
jpo the page the script is on is inaccessible. will retry some other time.
Posted 73 months ago.
(permalink)
|
|
ah, well, flickr made some changes and the script is broken.
from the flickr blog "and the display of your photostream views is on your "Popular" page." www.flickr.com/news.gne#202
Posted 73 months ago.
(permalink)
|
|
Yes, I noticed last night that their new changes had busted that script :( Too bad, it's so nice!
Posted 73 months ago.
(permalink)
|
|
I'm beginning to think that they're doing it on purpose :)
Posted 73 months ago.
(permalink)
|
|
I miss it already :( I hope it's fixable
Posted 73 months ago.
(permalink)
|
|
Is the graph still down ?....
Posted 73 months ago.
(permalink)
|
|
Yeah I found the script about a week before it broke. I thought it was really neat
Posted 73 months ago.
(permalink)
|
|
@Mr Jaded: LOL, I'm starting to think so too!
The updated version (1.08) of the script is now available. This fixes the script to work with the most recent Flickr revisions to how the view is displayed, as shown here:

Note that the script is obviously very sensitive to the exact placement and formatting of the view data. Flickr has tinkered with this several times since the Gamma site redesign, and will probably continue to do so in the future. If the format changes again and the script stops working, leave a note here or on the main script page.
Posted 73 months ago.
(permalink)
|
|
I installed this version but I still get weird figures... normally i have a couple hundred views per day but there's two days I had 8000 and 10.000 views, that can't be correct
Posted 73 months ago.
(permalink)
|
|
thanks for the fix jpo! :)
Posted 73 months ago.
(permalink)
|
|
@ėtı - see my notes above on cleaning up erroneous data. With all the tinkering Flickr has been doing to the site, it's possible that your data got corrupted somehow (or of course, it's also possible that there is something wrong with the script).
Originally posted 73 months ago.
(permalink)
jpo edited this topic 73 months ago.
|
|
@jpo - Thanks for fixing the most re-written gm flickr script in the flickrverse!
@eti - I think that the reason your figures are haywire is the same as mine were; either you've let someone else access their flickr account on your machine or you have more than one flickr ID.
The thing to do is check the script prefs by typing "about:config" into the address bar and narrowing the selection by searching for "flickr". You might see a string like this ",,,,65000,65250,233,65555, 68104,". Can you spot the wrong number in the sequence? All you need to do is replace each of the wrong numbers with "right" ones - in this instance you might choose to change "233" to "65330"...
Originally posted 73 months ago.
(permalink)
Mr Jaded edited this topic 73 months ago.
|
|
Mr Jaded is right on target with his comment about cleaning up incorrect data. In his example, you can replace the "230" with any value that seems reasonable (producing something like ",,,,65000,65250,65330,65555, 68104,"), or you can just remove the "230" (producing ",,,,65000,65250,,65555, 68104,"). In either case, be sure not to add or remove any commas.
Note that in newer versions of the script (1.07 and greater) have been enhanced to support multiple userids on the same machine, so if the problem was caused by multiple users, it should work properly going forward. If you're using an older version, please upgrade to the current version (1.08).
Posted 72 months ago.
(permalink)
|
|
Graph was there yesterday and gone today. Most current script and FF in use. Any suggestions?
Posted 72 months ago.
(permalink)
|
|
its working fine for me at the moment, though ive just noticed a bug.
your photostream can be accessed at one of 2 urls, 1 is the url with your username on the end and 1 is with your userid eg 2345234@N00 or whatever it is. some "flickr hacks/apps" such as Flickr Scout redirect you to the url with the userid on the end. this script treats the 2 different urls as being 2 different users photostreams. so creates a separate graph for each.
Originally posted 72 months ago.
(permalink)
steeev (a group admin) edited this topic 72 months ago.
|
|
Thanks steeev. Just got back on here and its now working. I didn't do anything.
Anyway, thanks to all the Flickr Hacks. You guys are great, keep up the Flickrtastic work.
Bob
Posted 72 months ago.
(permalink)
|
|
Sorry to all that have been experiencing problems with the graph. The graph is not part of Flickr itself, but rather is generated by an application hosted on an external server. This public (and free) service has occasional hiccups, which is why sometimes the graph fails to appear for a few hours (it happens to me too).
@steev, thanks for pointing out the issues with the two different usernames. I will ponder that one a bit and see if I can come up with a solution.
Posted 72 months ago.
(permalink)
|
|
a simple fix would be to just use the nsid (userid) for each user instead of username as the key for storing the data.
you can get that value from the following variable: unsafeWindow.global_nsid
the only problem with that is you would also need to add a little bit of code to replace the username with the nsid in existing users stored data. though new users should be fine
Originally posted 72 months ago.
(permalink)
steeev (a group admin) edited this topic 72 months ago.
|
|
Thanks jpo. I didn't realize the script accessed an external server. Its up to the disappearing act again. Now I know to just be patient. Thanks again.
Bob
Posted 72 months ago.
(permalink)
|
|
यश says:
very useful one. thanks jpo man.
Posted 68 months ago.
(permalink)
|
|
Many days that loading my photos page appears this error message: "Could not generate graph. Please try again later."
Has anyone the same problem?
Posted 67 months ago.
(permalink)
|
|
yes, same here....
Posted 67 months ago.
(permalink)
|
|
Me too...
Posted 67 months ago.
(permalink)
|
|
Same for me...
Posted 67 months ago.
(permalink)
|
 |
auctionsair [deleted] says:
yup...
Posted 67 months ago.
(permalink)
|
|
same here
Posted 67 months ago.
(permalink)
|
|
aye
Posted 67 months ago.
(permalink)
|
|
yep !
Posted 67 months ago.
(permalink)
|
|
Yes!
Posted 67 months ago.
(permalink)
|
|
any news on getting this fixed?
Posted 67 months ago.
(permalink)
|
 |
auctionsair [deleted] says:
Come on guys
Posted 67 months ago.
(permalink)
|
|
hmm .. recently discovered this great feature ..
@jpo? any news on this one?
Is there a chance to get the code for the webapp? Can I possibly host it myself?
Posted 66 months ago.
(permalink)
|