Advertisement
by Tlik » Sat Jun 01, 2013 5:53 pm
by [violet] » Sat Jun 01, 2013 6:32 pm
Afforess wrote:Search function completed! Restart your browsers! You can search the entire RMB post history of any region.
by Afforess » Sat Jun 01, 2013 6:45 pm
[violet] wrote:Afforess wrote:Search function completed! Restart your browsers! You can search the entire RMB post history of any region.
Whoa! That is not good. The way you have done this, it will load the entire RMB, ten posts at a time, and load full nation data & flags for every single poster, regardless of whether their posts are contained in the search results.
For example, I searched for "gobbledygook" in Democratic Socialist Assembly and it issued 1,441 requests, of which about a thousand involved loading up to 10 nations.
I appreciate that there's a "Cancel" button, and the requests take place over a couple of minutes, but that is no good. One search in a medium-sized region can't require us to make 10,000 nation loads. Text-search of RMBs needs to happen server-side.
[violet] wrote:Also, I feel like the automatic 10-second refresh is too frequent. Someone walks away from their computer for half an hour and this extension will make 180 requests while they're gone.
Tlik wrote:Additionally, with the Real-Time RMB, could the timestamps update constantly? I'm going on the basis that because I've seen it on other websites it shouldn't be too hard, but I've no idea if it's possible in this case. It would be nice, though.
by [violet] » Sat Jun 01, 2013 7:08 pm
Afforess wrote:Your search example is a worst case example. If you search for a common term like "the" it will only have to make 1-2 requests and then stop after 10 results are available. More requests are then only made if the user scrolls near the bottom of the page.
Regarding the load, I have little understanding how the NationStates works in the backend, other than it's a system of flatfiles - but are you telling me that loading RMB posts also loads the entire nation information? I hesitate to criticize this wonderful site, but that seems like a really bad design.
I definitely don't want to be causing unreasonable bandwidth/server load on this site, so please make suggestions about how I could improve this.
[violet] wrote:Also, I feel like the automatic 10-second refresh is too frequent. Someone walks away from their computer for half an hour and this extension will make 180 requests while they're gone.
30 seconds seem more reasonable? I had it at 60 seconds earlier and it seemed too slow.
by Afforess » Sat Jun 01, 2013 7:16 pm
[violet] wrote:Afforess wrote:Your search example is a worst case example. If you search for a common term like "the" it will only have to make 1-2 requests and then stop after 10 results are available. More requests are then only made if the user scrolls near the bottom of the page.
Yep, I noticed that, but that's the best case. The worst case is a user in United North America searches for a word that doesn't exist; in that situation, the extension sends us about 12,000 requests.Regarding the load, I have little understanding how the NationStates works in the backend, other than it's a system of flatfiles - but are you telling me that loading RMB posts also loads the entire nation information? I hesitate to criticize this wonderful site, but that seems like a really bad design.
Looking up almost anything about a nation requires the whole thing to be loaded. it's not possible to just extract its flag or type or whatever. Which is indeed a really bad design, for this kind of thing. But it's the way we are.
[violet] wrote:I definitely don't want to be causing unreasonable bandwidth/server load on this site, so please make suggestions about how I could improve this.
The RMB database is about 500M and it's no problem to search it. For example, if I simulate the "gobbledygook" search via SQL, I get an "Empty set" response in 0.03 seconds. Which is why I say text search needs to happen server-side: that's 0.03 seconds and 0 nation loads vs the extension's 1,441 requests and 10,000 nation loads. There's nothing you can do to improve its searching ability short of what you've already done (e.g. stopping after X successful hits), because you can't search the whole RMB without fetching it all first.
So what we need to do is let your extension access those search results, so it can make a request like "/page=ajax/a=rmbsearch/region=capitalist_paradise/text=Hello/start=0/limit=10". Then it can display the result.
[violet] wrote:Of course, then I would probably steal the feature for the rest of the site. And then you would code some more stuff, and I would get sick of playing catch-up, and you could become an admin and do it yourself. But for now, this would work.
[violet] wrote:
30 seconds seem more reasonable? I had it at 60 seconds earlier and it seemed too slow.
Yeah, or if you're feeling ambitious, have it fetch every 10s for the first 2 minutes, then steadily less frequently, on the assumption that if the user hasn't done anything for 5 minutes, they're probably not sitting there just staring at the page. I don't mind fairly frequent requests if they're actually useful; it's the pointless requests that I want squashed.
by [violet] » Sat Jun 01, 2013 7:42 pm
Afforess wrote:[violet] wrote:Looking up almost anything about a nation requires the whole thing to be loaded. it's not possible to just extract its flag or type or whatever. Which is indeed a really bad design, for this kind of thing. But it's the way we are.
That's unfortunate. If I start keeping track of this sort of data myself, will it still be a problem? If I have a direct link to a nations flag for example, without hitting ns.net or the api, will that cause a nation load?
[violet] wrote:So what we need to do is let your extension access those search results, so it can make a request like "/page=ajax/a=rmbsearch/region=capitalist_paradise/text=Hello/start=0/limit=10". Then it can display the result.
Wait - so the RMB posts are actually in a separate database? If so - way cool. If it's easy to expose a query like that, I would switch over in a heartbeat.
[violet] wrote:Of course, then I would probably steal the feature for the rest of the site. And then you would code some more stuff, and I would get sick of playing catch-up, and you could become an admin and do it yourself. But for now, this would work.
Where do I sign up for this alternate reality?
by Afforess » Sat Jun 01, 2013 7:53 pm
[violet] wrote:
Wait - so the RMB posts are actually in a separate database? If so - way cool. If it's easy to expose a query like that, I would switch over in a heartbeat.
It is easy. We maybe want to think about what's next, though. After this, will you want to add searching for RMB posts by a particular nation? Or by date? What about combining search criteria? It would be easier to build the interface once properly than reconfigure it all the time for new features.
[violet] wrote:
Where do I sign up for this alternate reality?
We are always looking tosucker inappoint new admins. It's a long slow process because of security reasons, i.e. it would be bad if we gave someone code access and they did something naughty with it. But if you're interested in writing code for the game then I'm interested in using it.
You could also do something like Northrop-Grumman's "Dark" theme, which began as a browser extension and is now available to all players directly from the Settings page. N-G builds that by himself and emails in patches. You could have a theme that supplies its own JavaScript.
by Afforess » Sat Jun 01, 2013 8:10 pm
Feux wrote:This is awesome. Great work.
EDIT:- Real time RMB: Loads new RMB posts in the page, without refreshing
Do you think you could apply this to telegrams as well?
by Feux » Sat Jun 01, 2013 8:23 pm
Afforess wrote:Feux wrote:This is awesome. Great work.
EDIT:
Do you think you could apply this to telegrams as well?
I can make the "Telegrams" indicator on the sidebar update the count, but I don't want to add features to the actual telegrams page (infinite scroll/search). I wouldn't trust a browser extension to read telegrams, and neither should you!
TheBestDudeInHistory wrote:Feux is what would happen if I had my shitposting physically removed, isolated, and permitted to become sentient on its own. And I mean that in the best way possible. Clearly I need to marry Feux.
by Afforess » Sat Jun 01, 2013 9:15 pm
Feux wrote:Afforess wrote:I can make the "Telegrams" indicator on the sidebar update the count, but I don't want to add features to the actual telegrams page (infinite scroll/search). I wouldn't trust a browser extension to read telegrams, and neither should you!
I'm talking about the telegrams indicator updating.
by [violet] » Mon Jun 03, 2013 7:47 pm
by Afforess » Mon Jun 03, 2013 9:10 pm
[violet] wrote:I've added a search backend for RMBs. Currently it can only be accessed via calls to /page=ajax/a=rmbsearch. Then you throw in extra fields like:All of the above may change and is just for playing around with to help us figure out what a good RMB search interface should look like.
- rmbsearch-text=(text to search for)
- rmbsearch-author=(real_name of nation to find posts from)
- rmbsearch-region=(real_name of region to limit search to)
- rmbsearch-limit=(max. number of posts to retrieve, default is 20, cannot exceed 20)
- rmbsearch-offset=(skip first X number of search results)
- rmbsearch-reverse=(1 if you want results in reverse order)
Edit: Oh and the search text works like this, so you can use tokens to search for phrases, exclude words, etc.
Edit 2: Example: Who's mentioned Testlandia in Osiris?
by Afforess » Mon Jun 03, 2013 9:37 pm
by [violet] » Mon Jun 03, 2013 9:45 pm
Afforess wrote:The html encoding changes spaces to %20 and that seems to be ignored.
by Afforess » Tue Jun 04, 2013 5:22 am
[violet] wrote:Afforess wrote:The html encoding changes spaces to %20 and that seems to be ignored.
I think maybe what you're seeing is the implied OR between words. Which seems weird to me, but that's the MySQL implementation. You need a "+" before the word to make it an implied AND. Which would be encoded in an URI as %2B.
by TaQud » Tue Jun 04, 2013 3:16 pm
by Afforess » Tue Jun 04, 2013 6:48 pm
[violet] wrote:I've added a search backend for RMBs. Currently it can only be accessed via calls to /page=ajax/a=rmbsearch. Then you throw in extra fields like:All of the above may change and is just for playing around with to help us figure out what a good RMB search interface should look like.
- rmbsearch-text=(text to search for)
- rmbsearch-author=(real_name of nation to find posts from)
- rmbsearch-region=(real_name of region to limit search to)
- rmbsearch-limit=(max. number of posts to retrieve, default is 20, cannot exceed 20)
- rmbsearch-offset=(skip first X number of search results)
- rmbsearch-reverse=(1 if you want results in reverse order)
Edit: Oh and the search text works like this, so you can use tokens to search for phrases, exclude words, etc.
Edit 2: Example: Who's mentioned Testlandia in Osiris?
by [violet] » Tue Jun 04, 2013 7:47 pm
by New Worcester » Wed Jun 05, 2013 3:15 am
by Afforess » Wed Jun 05, 2013 6:24 am
New Worcester wrote:Violet? Are you Max Barry? It seems that you don't any nation.
by Corporation de Apple » Wed Jun 05, 2013 6:34 am
<div class="btn-group">
<button class="btn btn-medium">Leave a Message</button>
<button class="btn btn-medium">Search Messages</button>
</div>
<span class="badge">Quote</span>
by Astarial » Wed Jun 05, 2013 1:25 pm
by Crushing Our Enemies » Wed Jun 05, 2013 1:27 pm
by Hileville » Wed Jun 05, 2013 1:41 pm
Crushing Our Enemies wrote:First off, this whole think is awesome. You are doing amazing work for NationStates players.
That being said, I don't have a use for most of these features, and kind of dis-prefer some of the cosmetic changes this add-on makes. However, I LOVE some of these features, and would like be able to pick and choose which to turn on and off. Any chance that users could someday get the capability to toggle each feature individually?
by Afforess » Wed Jun 05, 2013 2:00 pm
Crushing Our Enemies wrote:First off, this whole think is awesome. You are doing amazing work for NationStates players.
That being said, I don't have a use for most of these features, and kind of dis-prefer some of the cosmetic changes this add-on makes. However, I LOVE some of these features, and would like be able to pick and choose which to turn on and off. Any chance that users could someday get the capability to toggle each feature individually?
Hileville wrote:Crushing Our Enemies wrote:First off, this whole think is awesome. You are doing amazing work for NationStates players.
That being said, I don't have a use for most of these features, and kind of dis-prefer some of the cosmetic changes this add-on makes. However, I LOVE some of these features, and would like be able to pick and choose which to turn on and off. Any chance that users could someday get the capability to toggle each feature individually?
I completely agree wit this. I would prefer an option to disable a couple of the features and would switch to this immediately.
Advertisement
Users browsing this forum: Improper Classifications, Julianavill, Loveable Dogs, Mavenu, Millopo, National State of Britain, Nekoatsumelandia, Patolia, The Southern Dependencies
Advertisement