Campinia wrote:I also think Fris is mistaken, and most if not all scripts currently running do check for this.
I received several double TGs from recruiters when I created a new nation and moved it between feeders.
Advertisement
by [violet] » Thu Apr 26, 2012 4:56 pm
Campinia wrote:I also think Fris is mistaken, and most if not all scripts currently running do check for this.
by [violet] » Thu Apr 26, 2012 5:01 pm
Cerberion wrote:I'm not sure if my request was overlooked or in some way impossible.
I'm developing a tool that will run some stats on WA nations in my region. As far as I can tell what I will have to do initially is get the regions nation shard, and then step through each nation to discover if they are WA members, and then assess who is endorsing who.
That's going to create a lot of API calls so it would be extremely helpful if I could get a shard added to the regions feed to just call out the WA nations.
If that's not possible or if I have overlooked it, please let me know.
by [violet] » Thu Apr 26, 2012 5:08 pm
Zemnaya Svoboda wrote:[violet] wrote:What info are you gathering? If you want values on a single scale for 2-15 nations, then yeah, I can see that HTML scraping is easier. But the API lets you gather data on lots of scales at once, and at a faster rate, so it's just different implementations of the same thing.
The Influence score. I don't really care about all the other scores of the non-WA nations in TNP, but the Influence score I want to track.
by [violet] » Thu Apr 26, 2012 5:15 pm
Cerberion wrote:It just seems counter productive to have to parse all of the nations when you are only interested in a handful.
by [violet] » Thu Apr 26, 2012 5:30 pm
Poopcannon wrote:Sorry to be asking a lot of things. Also, not certain where exactly to ask this.
What is the averaging time for API requests? I assume I can't send 50 requests in 1 second and then none for 29 and get away with it? I want to know for the case where I have to perform several API requests that need to be done together. I'd like to do them quickly, but not so quickly that my script gets banned. (and of course limit my overall rate to 50 per 30 seconds)
by Cerberion » Thu Apr 26, 2012 5:47 pm
[violet] wrote:Cerberion wrote:It just seems counter productive to have to parse all of the nations when you are only interested in a handful.
The thing about the Daily Dumps, though, is they're relatively low-cost for us to generate, because we do it during the daily update, when all the nations need to be loaded and processed anyway. Also, it doesn't matter how many people access them: there's no extra load created. When you make an API call (or scrape an HTML page), though, that's all pure additional load.
by Zemnaya Svoboda » Thu Apr 26, 2012 6:42 pm
[violet] wrote:Zemnaya Svoboda wrote:
The Influence score. I don't really care about all the other scores of the non-WA nations in TNP, but the Influence score I want to track.
Since The North Pacific has 4,900 nations, isn't it faster to use a Daily Dump? At 15 nations per page, HTML scraping will require 327 requests, which at a rate of 10/minute will take more than half an hour. Even via an API, we don't really have the capacity to load and analyze thousands of nations in a short period of time, which is why we make the Dumps available.
[violet] wrote:Poopcannon wrote:Sorry to be asking a lot of things. Also, not certain where exactly to ask this.
What is the averaging time for API requests? I assume I can't send 50 requests in 1 second and then none for 29 and get away with it? I want to know for the case where I have to perform several API requests that need to be done together. I'd like to do them quickly, but not so quickly that my script gets banned. (and of course limit my overall rate to 50 per 30 seconds)
We only measure in 30-second blocks at the moment, so technically you could make 50 simultaneous requests, then none for 29 seconds, and not fall foul of the auto-banner. However, this would not be a good practice, and may be interpreted as a Denial of Service attack by servers or proxies somewhere along the network chain (including our provider).
Modern browsers limit themselves to between 2 and 6 simultaneous connections, but this is a pretty high number, balanced out by the fact that browsers tend to sit idle afterward while the user reads the web page.
Unless you have a very good reason, I'd say that a single-purpose script should only make 1 simultaneous request. That is, it should request data and wait until it receives it before asking for more. (You get a response in under half a second anyway, so your limiting factor is still the Rate Limit.) This is decidedly so if your script runs in response to user input; e.g. it is a web page that fetches data whenever a visitor clicks something. In this case, when five visitors come along to your site at once, you probably generate five times the usual number of simultaneous API connections.
Also, you may have (or develop) a couple of different kinds of scripts, which run in parallel. So even if you keep your scripts to 1 simultaneous connection each, you may wind up making quite a lot in total.
by Cerberion » Thu Apr 26, 2012 9:37 pm
by Zemnaya Svoboda » Thu Apr 26, 2012 10:07 pm
Cerberion wrote:Mildly off topic but I did decide to parse the nations.xml feed with nokogiri.
It parsed out the xml in 9.5 seconds, including the time to download the nations.xml feed from NS.
Just thought I'd share that as I was impressed greatly by the performance and, as stated previously, attempting to parse the XML in ruby using SAX2 was dreadful.
I'll stop my whining now and be satisfied with the nations.xml.
Thanks again for the folks that tried to guide me in the right direction. It's very much appreciated.
by Poopcannon » Fri Apr 27, 2012 5:11 am
[violet] wrote:Poopcannon wrote:Sorry to be asking a lot of things. Also, not certain where exactly to ask this.
What is the averaging time for API requests? I assume I can't send 50 requests in 1 second and then none for 29 and get away with it? I want to know for the case where I have to perform several API requests that need to be done together. I'd like to do them quickly, but not so quickly that my script gets banned. (and of course limit my overall rate to 50 per 30 seconds)
We only measure in 30-second blocks at the moment, so technically you could make 50 simultaneous requests, then none for 29 seconds, and not fall foul of the auto-banner. However, this would not be a good practice, and may be interpreted as a Denial of Service attack by servers or proxies somewhere along the network chain (including our provider).
Modern browsers limit themselves to between 2 and 6 simultaneous connections, but this is a pretty high number, balanced out by the fact that browsers tend to sit idle afterward while the user reads the web page.
Unless you have a very good reason, I'd say that a single-purpose script should only make 1 simultaneous request. That is, it should request data and wait until it receives it before asking for more. (You get a response in under half a second anyway, so your limiting factor is still the Rate Limit.) This is decidedly so if your script runs in response to user input; e.g. it is a web page that fetches data whenever a visitor clicks something. In this case, when five visitors come along to your site at once, you probably generate five times the usual number of simultaneous API connections.
Also, you may have (or develop) a couple of different kinds of scripts, which run in parallel. So even if you keep your scripts to 1 simultaneous connection each, you may wind up making quite a lot in total.
by Johz » Tue May 01, 2012 1:22 pm
by Fischistan » Tue May 01, 2012 1:56 pm
Johz wrote:I was just wondering if any of the API shard/tags return a value of 'None' in any situation?
Xavier D'Montagne
Fischistani Ambassador to the WA
Unibot II wrote:It's Carta. He CANNOT Fail. Only successes in reverse.
The Matthew Islands wrote:Knowledge is knowing the Tomato is a fruit. Wisdom is knowing not to put it in a fruit salad.
Anthony Delasanta wrote:its was not genocide it was ethnic cleansing...
Socorra wrote:A religion-free abortion thread is like a meat-free hamburger.
by Johz » Wed May 02, 2012 10:49 am
by ALUCARD GRIMUS » Wed May 02, 2012 1:44 pm
by Spartzerium » Wed May 02, 2012 1:50 pm
ALUCARD GRIMUS wrote:I'm not sure if this issue was risen by anyone yet, but the daily data dump (this one: http://www.nationstates.net/pages/regions.xml.gz) has several regions that repeat themselves.
For example:Goauld System Lords
Ether
Ether
Ether
Ether
Ether
Ether
Kingdom of Northern Ireland
Novels and Plays
Novels and Plays
Ionia
Karrhai
Amarr Empire
The Free Land
Magicka
Chukaku
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
Is this supposed to happen?
by ALUCARD GRIMUS » Wed May 02, 2012 4:14 pm
Spartzerium wrote:ALUCARD GRIMUS wrote:I'm not sure if this issue was risen by anyone yet, but the daily data dump (this one: http://www.nationstates.net/pages/regions.xml.gz) has several regions that repeat themselves.
For example:Goauld System Lords
Ether
Ether
Ether
Ether
Ether
Ether
Kingdom of Northern Ireland
Novels and Plays
Novels and Plays
Ionia
Karrhai
Amarr Empire
The Free Land
Magicka
Chukaku
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
The Isle of Wight
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
Galapagos
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
USSR and Eastern Europe
Is this supposed to happen?
Doesn't seem to be a problem with the data dump itself, works just fine for me. I'd assume it's an issue with the program you're opening it with.
by Spartzerium » Wed May 02, 2012 4:58 pm
by Ballotonia » Thu May 03, 2012 12:24 am
by Scoochi2 » Fri May 04, 2012 6:37 am
<PASSWORDED>None</PASSWORDED>
<PASSWORDED>Displayed</PASSWORDED>
<PASSWORDED>Hidden</PASSWORDED>
by Unibot II » Sun May 06, 2012 1:58 pm
Scoochi2 wrote:Would it be possible to add in an extra shard to indicate whether a region has a password or not?
Could this be included in the daily dump?
Possible examples:
- Code: Select all
<PASSWORDED>None</PASSWORDED>
<PASSWORDED>Displayed</PASSWORDED>
<PASSWORDED>Hidden</PASSWORDED>
Vocenae wrote:Unibot, you have won NS.
General Halcones wrote:Look up to Unibot as an example.
by SunRawr » Sun May 13, 2012 5:58 pm
The Blaatschapen wrote:
Is it also possible to have it the other way around? Ie. An API that shows which regions have @@TAG@@ ?
Either way, I see now a possibility to do some multiple tag searches on a daily db dump(it is/will be included in the dump right?) to do some multiple TAG searches (eg. combining Democratic and Founderless). *goes off to sleep and sees some nice coding ahead*
by Fischistan » Sun May 13, 2012 6:13 pm
Xavier D'Montagne
Fischistani Ambassador to the WA
Unibot II wrote:It's Carta. He CANNOT Fail. Only successes in reverse.
The Matthew Islands wrote:Knowledge is knowing the Tomato is a fruit. Wisdom is knowing not to put it in a fruit salad.
Anthony Delasanta wrote:its was not genocide it was ethnic cleansing...
Socorra wrote:A religion-free abortion thread is like a meat-free hamburger.
by Ballotonia » Sun May 13, 2012 11:33 pm
SunRawr wrote:The Blaatschapen wrote:
Is it also possible to have it the other way around? Ie. An API that shows which regions have @@TAG@@ ?
Either way, I see now a possibility to do some multiple tag searches on a daily db dump(it is/will be included in the dump right?) to do some multiple TAG searches (eg. combining Democratic and Founderless). *goes off to sleep and sees some nice coding ahead*
I couldn't find an answer to this and wanted to bring it back up. It would be very useful.
by The BlAAtschApen » Mon May 14, 2012 4:58 am
Advertisement
Users browsing this forum: No registered users
Advertisement