Request: Recently added on Profile page

DiscussãoHacking LibraryThing

Aderi ao LibraryThing para poder publicar.

Request: Recently added on Profile page

Este tópico está presentemente marcado como "adormecido"—a última mensagem tem mais de 90 dias. Pode acordar o tópico publicando uma resposta.

Set 6, 2010, 8:40pm

I've just found this group, and wondered if you took requests? There's a discussion of improvements to the profile page, and I had an idea on how to get the 'recently added' section from your Home page copied across to your Profile page, but I don't know if it's possible. Here's the idea:

Your 'recently added' images are available in the source code of your recently added module on the Home page. They lie between the strings:
<div id="recentbooks_inside">
</div><br style="clear: both;"></div>

Can this be extracted from the home page and added to the Profile page using Greasemonkey?

Out 3, 2010, 2:57pm

Sorry I somehow missed this, Noisy! Okay, so I'm not sure if it's doable (will depend on how modular the recently added stuff is), but I have to ask a stupid question. You're wanting this done for just you, right? You know that when other people view your homepage, it won't show any of these changes?

Out 3, 2010, 3:31pm

Looking at this a bit further, it's not easily doable, but I think it is doable. The problem is that greasemonkey is generally very good about altering what's on the current page. So I could go and re-arrange stuff, hide some stuff, change styles on others, etc. I could also add in some functions like clicking on things that weren't previously clickable.

But the problem here is that I need to get data that's off a different page other than the one that's loaded. When you're looking at your Profile page, the code would have no idea what was on your Home page under Recently added. So what it'd have to do is initiate a request back to LT to fetch that data. Another unfortunate thing is that even though a lot of the stuff on the Home page is extremely modular (meaning I could request just that section), Recently Added is not.

So what would have to happen is that your profile would load, then the greasemonkey script would kick in (it never does until after the page you're on has loaded) and fetch your Home page in the background. It would rip it apart to get that div (easier than it could be, thanks to that recentbooks_inside id) and re-embed it. All that extra fetching and processing will probably add a delay. This means your profile would show as it is now, then after a second or two, the Recently added box would pop in.

There are a couple of other directions I could take, such as using the widget code (though that limits me to covers only if I want it to be a horizontal fashion like on Recently added) or the LT Javascript API (for which I'd need to do a bit of extra work to get it styled right, but it might speed it up since it loads a lot less data than the entire Home page).

Out 4, 2010, 2:30pm

Thanks for taking a look. I see now that getting info from a different page wouldn't be exactly straightforward. Just thought it worthwhile asking to see if it was trivial.

Still, I've left my profile page stagnant for a long while now - if I was really concerned about getting that data showing, I'd update my page on a weekly basis. ;-)

Out 4, 2010, 2:42pm

4> Right, but do you see what I mean that other people wouldn't see any changes that the greasemonkey script did for you? It only changes the display in your browser. Still not sure if that's what you intended.

Out 5, 2010, 1:34pm

Ah, thanks for re-iterating. I get your point now. That does degrade the utility.

I'm sure this has been requested from TPTB many times in the past, so perhaps we just need to wait another two weeks for it to be implemented as a formal improvement.

Out 5, 2010, 1:50pm

Well, what would be really nice is if LT widgets were allowed on our homepage. Tim cringed at the idea of a MySpace-ification by allowing javascript on the homepage, but I think he never thoroughly considering allowing ONLY LT widgets. You can find other threads that talk about it.

Okay, thanks for checking back. I'm not going to do any work on it, then. If you do decide it would be really useful to you, I'd have a go. It would be more work than a lot of greasemonkey scripts, but might be fun.