Multi-Tag Search Extension

Anything shuushuu related that doesn't fit into the other forums :)
Merun
Posts: 2897
Joined: Sat Mar 17, 2007 9:44 am
Location: NoWheRe

Re: Multi-Tag Search Extension

Post by Merun »

I totally have no idea what users have access to nowadays, since in 2007 I was already a tagger xD
Merun @ Twitter
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

Tensa wrote:Taking it literally, Admins, Mods and Taggers for all images.
But I don't know about normal members for their uploaded images. Started doing it like that after I became a tagger.
Ah, so then that's probably it..... I don't think trying to hack the site is a good idea so it will probably remain a broken part of the script until I can guess where the problem is; but ah well, it's a first script anyhow. hopefully I can in the future make useful scripts for the site that don't break existing features. :wink:
User avatar
Tensa
Posts: 1265
Joined: Sun Sep 13, 2009 1:53 pm
Location: 絵 収集

Re: Multi-Tag Search Extension

Post by Tensa »

A subscription script would be awesome XD (tags, sources~) Although that can be done by searching.
Image
User avatar
Gicchan
Posts: 112
Joined: Thu Jan 13, 2011 4:05 am
Location: In your heart <3
Contact:

Re: Multi-Tag Search Extension

Post by Gicchan »

Tensa wrote:A subscription script would be awesome XD (tags, sources~) Although that can be done by searching.
^ This, I do really want. XD Though a subscription script would make me feel lazy to search for images through pages. :P
Image

(x) sometimes the night is dark and stormy,
sometimes the ghosts of what you had run their fingers down a spine.
User avatar
Evangeline Mcdowell
Site Admin
Posts: 852
Joined: Sun May 14, 2006 3:00 pm

Re: Multi-Tag Search Extension

Post by Evangeline Mcdowell »

Tensa wrote:Taking it literally, Admins, Mods and Taggers for all images.
But I don't know about normal members for their uploaded images. Started doing it like that after I became a tagger.
Normal members do not have the quicktag feature, even for their uploaded images.
Merun
Posts: 2897
Joined: Sat Mar 17, 2007 9:44 am
Location: NoWheRe

Re: Multi-Tag Search Extension

Post by Merun »

People can use their browser bookmark to save searches, which should come close to a subscription.
Merun @ Twitter
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

Merun wrote:People can use their browser bookmark to save searches, which should come close to a subscription.
True, but usually subscriptions give you a number of new ones... it would be an awesome extension and you could even use FF's HTML5 local storage to keep track of them, but I haven't done much ajax. It is an awesome idea though.
Merun
Posts: 2897
Joined: Sat Mar 17, 2007 9:44 am
Location: NoWheRe

Re: Multi-Tag Search Extension

Post by Merun »

No need to use AJAX and I'm not sure but i think there is already some kind of local storage in Greasemonkey. Just keep the first result assuming that it's anti chronologically ordered. Then if it's no longer the first, then it means there are new one. Problem is that there is no notification but I don't think any amount of Greasemonkey scripting would solve this xD.
Merun @ Twitter
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

Merun wrote:No need to use AJAX and I'm not sure but i think there is already some kind of local storage in Greasemonkey. Just keep the first result assuming that it's anti chronologically ordered. Then if it's no longer the first, then it means there are new one. Problem is that there is no notification but I don't think any amount of Greasemonkey scripting would solve this xD.
That's the thing. there's no notification of new images sent out, so that would have to be built. One way to do it is to fetch the page with ajax (GET http://e-shuushuu.net/?=tagnumber+tagnumber) and have the top result stored with local storage (works like cookies but has more room and is easier to work with). Then when the user loads the homepage, execute the same ajax and compare the result. That's how you could tell if there are new ones. Counting those new entries to give a result like

Subscriptions
smile (2 new)
blush (5 new)
dress


wouldn't be too hard after you got that part down, but I've never really worked with ajax. Anyone know if you can GET a whole HTML page and navigate it with document.getElement type calls?

EDIT: OSRSLY! I just did it O_O ... this is awesome... and easier than I thought.
Merun
Posts: 2897
Joined: Sat Mar 17, 2007 9:44 am
Location: NoWheRe

Re: Multi-Tag Search Extension

Post by Merun »

Well, I don't think the admin will be happy to have a script hitting the database for that xD. And I had in mind that you still had to load the page, but yeah, AJAX is needed if you don't. You could even enable the script for any webpage so that it would always check, but see my first sentence lol.
Merun @ Twitter
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

Merun wrote:Well, I don't think the admin will be happy to have a script hitting the database for that xD. And I had in mind that you still had to load the page, but yeah, AJAX is needed if you don't. You could even enable the script for any webpage so that it would always check, but see my first sentence lol.
Good point.... don't want a denial of service thing going. O_O;; Definitely it's a better idea to have it just check if there are any new images. Then, when you actually visit the page that the search is for, it will add a little sticker to posts that you have not seen yet. this way there is only one automatic hit per subscription........ rather than.... hundreds........ yeah that idea was a bomb. Another thing I could do (If I really wanted to do something crazy) is have the script load the page for each subscription and when the user clicks on the link have it just replace the html on the page. That would mean only 1 hit instead of 2... btw, who is the admin?
Merun
Posts: 2897
Joined: Sat Mar 17, 2007 9:44 am
Location: NoWheRe

Re: Multi-Tag Search Extension

Post by Merun »

Crazy idea while hitting less the database seems quite crazy with RAM usage, and considering how Firefox use it xD.


The admin is anonymous_object.
Merun @ Twitter
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

UPDATE: ... not for the subscriptions thing. XD I have found the error that was most likely causing a problem with the links. The source has been updated.
User avatar
A.Dantes
Posts: 172
Joined: Wed Nov 14, 2007 11:13 pm

Re: Multi-Tag Search Extension

Post by A.Dantes »

jQuery, although more than a little outdated, is already included on every page on the website. The top half of that script can be removed as a result.

There is a lot of repetition in selecting elements in the script. Performance wise, it would be better if you saved things like $('.tag') to a variable and just referenced that in the code. jQuery is scanning the entire DOM four times as much it needs to because of that.
User avatar
Alcuinus
Posts: 15
Joined: Tue Jun 14, 2011 1:18 pm

Re: Multi-Tag Search Extension

Post by Alcuinus »

A.Dantes wrote:jQuery, although more than a little outdated, is already included on every page on the website. The top half of that script can be removed as a result.

There is a lot of repetition in selecting elements in the script. Performance wise, it would be better if you saved things like $('.tag') to a variable and just referenced that in the code. jQuery is scanning the entire DOM four times as much it needs to because of that.
You examined my source code!
I'm honored. :D

You are correct. It could be much improved in that area. I'm rather lazy in the development process and I don't optimize my code until (in some cases) months after the bulk of it's done.

I also noticed that each page has jquery on it, but for some reason, greasemonkey wanted to isolate itself from that and I couldn't seem to just run JQuery without doing that weird business with the $ = unsafeWindow.jQuery; call. So I ended up just using someone else's code to get the JQuery in there. I only recently discovered that that was the call it needed. Now I just need to optimize the code.... a lot :P

Are you by any chance one of the developers here, Dantes?
Post Reply