How are you doing that, by the way? How often do you check each nation page for the happenings?
Advertisement
by Afforess » Mon Sep 02, 2013 1:28 am
by Tlik » Mon Sep 02, 2013 4:01 am
Afforess wrote:Tlik wrote:How are you doing that, by the way? How often do you check each nation page for the happenings?
It's pretty ingenious - it doesn't use the NS API, it scrapes the site. A players dossier can hold 2500 nations at once. Your reports page shows the happenings for all of those nations. I can clear the dossier with 1 request and use the advanced upload post form to cycle the next 2500 nations, rinse repeat. So i can upload 2500 nations to the dossier, scrap the reports page, then clear the dossier in 3 requests. I can collect happenings on all of NS in 43 batches and under 15 min.
The one downside is that I don't get exact time stamps, I have to parse and make a best guess. In fact the reports pages are so large it takes several seconds to parse and update happenings on my tiny server. Good thing the HTML site rate limit is roughly the same length of time.
I have 1.6M happenings stored already, adding ~70k a day. I have plans to begin to open up and document my backend server so other people can use it. I already use CORS/JSON for everything.
I think it's a pretty clever solution if I so say so myself.
by TaQud » Mon Sep 02, 2013 4:59 am
by Corporation de Apple » Mon Sep 02, 2013 10:29 am
TaQud wrote:i like the gameplay news
$("<li id='ns_newspaper'><a id='ns_newspaper_link' href='http://www.nationstates.net/page=news/?ns_newspaper=true'>GAMPLAY NEWS</a></li>").insertAfter($("#live_happenings_feed"));
$("<li id='ns_newspaper'><a id='ns_newspaper_link' href='http://www.nationstates.net/page=news/?ns_newspaper=true'>GAMEPLAY NEWS</a></li>").insertAfter($("#live_happenings_feed"));
by Usual People In Life » Mon Sep 02, 2013 11:05 am
by The Cosmos » Mon Sep 02, 2013 11:47 am
Olthar wrote:Awesome. From now on, I'll wear only thin leather straps covering my nipples and undercarriage.
New Maldorainia wrote:Alcohol, tobacco and firearms should be a store, not a government agency.
Thafoo wrote:Merconitonitopia wrote:~First world problems - waking up.
~Third world problems - not waking up.
Uieurnthlaal wrote:Oh, I see, he's asexual but likes riding bisexuals. I meant bicycles.
by Afforess » Mon Sep 02, 2013 11:50 am
Tlik wrote:Afforess wrote:It's pretty ingenious - it doesn't use the NS API, it scrapes the site. A players dossier can hold 2500 nations at once. Your reports page shows the happenings for all of those nations. I can clear the dossier with 1 request and use the advanced upload post form to cycle the next 2500 nations, rinse repeat. So i can upload 2500 nations to the dossier, scrap the reports page, then clear the dossier in 3 requests. I can collect happenings on all of NS in 43 batches and under 15 min.
The one downside is that I don't get exact time stamps, I have to parse and make a best guess. In fact the reports pages are so large it takes several seconds to parse and update happenings on my tiny server. Good thing the HTML site rate limit is roughly the same length of time.
I have 1.6M happenings stored already, adding ~70k a day. I have plans to begin to open up and document my backend server so other people can use it. I already use CORS/JSON for everything.
I think it's a pretty clever solution if I so say so myself.
Have you thought about using multiple nations, each with a portion of the total dossier? It would be harder to programatically ensure that each nation exists and add new nations, but it might save on the upload parts. I'm not sure how much of a saving you'd get, though, it depends how differently NS 'feels' logging into a new nation vs uploading a new dossier.
The Cosmos wrote:Gameplay News is awesome! However, I noticed that you misspelled Gameplay as "Gamplay"
by The Republic of Lanos » Mon Sep 02, 2013 2:37 pm
by Afforess » Mon Sep 02, 2013 3:21 pm
The Republic of Lanos wrote:Is there a way to disable the gameplay and happening feeds?
by Glen-Rhodes » Tue Sep 03, 2013 9:45 am
by [violet] » Tue Sep 03, 2013 4:50 pm
Afforess wrote:Tlik wrote:How are you doing that, by the way? How often do you check each nation page for the happenings?
It's pretty ingenious - it doesn't use the NS API, it scrapes the site. A players dossier can hold 2500 nations at once. Your reports page shows the happenings for all of those nations. I can clear the dossier with 1 request and use the advanced upload post form to cycle the next 2500 nations, rinse repeat. So i can upload 2500 nations to the dossier, scrap the reports page, then clear the dossier in 3 requests. I can collect happenings on all of NS in 43 batches and under 15 min.
by Afforess » Tue Sep 03, 2013 5:36 pm
[violet] wrote:Afforess wrote:It's pretty ingenious - it doesn't use the NS API, it scrapes the site. A players dossier can hold 2500 nations at once. Your reports page shows the happenings for all of those nations. I can clear the dossier with 1 request and use the advanced upload post form to cycle the next 2500 nations, rinse repeat. So i can upload 2500 nations to the dossier, scrap the reports page, then clear the dossier in 3 requests. I can collect happenings on all of NS in 43 batches and under 15 min.
Unfortunately, this is ridiculously load-generating for us. The only reason dossiers can hold 2500 nations is because few people ever exercise that limit. We can't actually support generating real-time reports on 2,500 nations on a regular basis. (Which is why it's not part of the API.)
I don't want to lower everyone's dossier limit, but I will have to do that or something like it if it's used in this way.
Edit: Oh, is this just you, scraping to a central server? I was thinking every NS++ user would be doing it. That's not so awful.
by Afforess » Tue Sep 03, 2013 5:37 pm
[violet] wrote:LOVE Gameplay News, by the way, and Live Happenings are super-interesting to watch.
by Afforess » Tue Sep 03, 2013 5:47 pm
Corporation de Apple wrote:TaQud wrote:i like the gameplay news
*Gamplay
Tyops, there are everywhere. Apart from that, it looks awesome.
In nationstates.js, Line 8 (per Notepad++)
- Code: Select all
$("<li id='ns_newspaper'><a id='ns_newspaper_link' href='http://www.nationstates.net/page=news/?ns_newspaper=true'>GAMPLAY NEWS</a></li>").insertAfter($("#live_happenings_feed"));
Becooomes...
- Code: Select all
$("<li id='ns_newspaper'><a id='ns_newspaper_link' href='http://www.nationstates.net/page=news/?ns_newspaper=true'>GAMEPLAY NEWS</a></li>").insertAfter($("#live_happenings_feed"));
Glen-Rhodes wrote:Please check your changes with the Antiquity theme. The Happenings Feed link is going crazy with that exclamation point.
by [violet] » Wed Sep 04, 2013 3:17 am
by Glen-Rhodes » Wed Sep 04, 2013 7:01 am
Afforess wrote:The Aniquity theme is the bane of my existence. It does everything in a slightly different and confusing to handle way from the default & dark theme. Thanks for the report... and don't think I am chastising you... do keep reporting bugs. I'll go patch this one up.
by Afforess » Wed Sep 04, 2013 8:22 am
[violet] wrote:Okay, I'm doing it: I will make real-time Happenings available. It's just too embarrassing to watch you have to jump through these hoops to make something cool.
So what we should have sometime next week is something with proper timestamps that you can query as often as you like.
by Afforess » Wed Sep 04, 2013 8:25 am
Glen-Rhodes wrote:Afforess wrote:The Aniquity theme is the bane of my existence. It does everything in a slightly different and confusing to handle way from the default & dark theme. Thanks for the report... and don't think I am chastising you... do keep reporting bugs. I'll go patch this one up.
I know how you feel. When I was still doing this kind of stuff, it was always a pain to make special changes for the Antiquity theme. But I refuse to join the rest of NS in using these newfangled themes. Unfortunately, I have to point out that the Jennifer Government logo is right in the middle of the Gameplay News page. :|
by Afforess » Wed Sep 04, 2013 6:43 pm
[violet] wrote:I swear Antiquity adds 10% to the development time of every new feature. It's a pain in the butt.
But it is nice to be able to view the site in its original form.
by Nightkill the Emperor » Wed Sep 04, 2013 6:49 pm
Nat: Night's always in some bizarre state somewhere between "intoxicated enough to kill a hair metal lead singer" and "annoying Mormon missionary sober".
Swith: It's because you're so awesome. God himself refreshes the screen before he types just to see if Nightkill has written anything while he was off somewhere else.
Advertisement
Users browsing this forum: Bagong Timog Mindanao, Cyptopir, Ebrein, Ezaekia, Merulla, Orange Creek, Pravoslavi, Radicalania, Republic of Madovia, Unknown24, Wing Como
Advertisement