
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
grepolis-js
Advanced tools
Require
var grepojs = require("grepolis-js");
Load Alliance Data $id, $name, $points, $towns, $members, $rank
grepojs.loadAllianceData(function () {
grepojs.data.each("SELECT points, name FROM alliances", function (err, row) {
console.log(row.points + ": " + row.name);
});
});
Load Player Data $id, $name, $alliance_id, $points, $rank, $towns
grepojs.loadPlayerData(function () {
grepojs.data.each("SELECT points, name FROM players WHERE rank < 15", function (err, row) {
console.log(row.points + ": " + row.name);
});
});
Load Island Data $id, $x, $y, $island_type, $available_towns, $good, $bad
grepojs.loadIslandData(function () {
grepojs.data.each("SELECT id, x, y FROM islands", function (err, row) {
console.log(row.id + ": " + row.x + "," + row.y);
});
});
Load Town Data $id, $player_id, $name, $island_x, $island_y, $number_on_island, $points
grepojs.loadTownData(function () {
grepojs.data.each("SELECT player_id, name FROM towns", function (err, row) {
console.log(row.player_id + ": " + row.name);
});
});
You can nest the load functions
grepojs.loadPlayerData(function () {
grepojs.loadTownData(function () {
grepojs.data.each("SELECT player_id, name FROM towns", function (err, row) {
grepojs.data.each("SELECT name FROM players WHERE id = " + row.player_id, function (err2, row2) {
console.log(row2.name + ": " + row.name);
})
});
});
});
You can also use grepojs.data outside of the load_data function call backs, as long as the data you want to read has already been loaded.
Load all data from the set data url
This will run he start function after all of the data has been loaded into the grepojs.data object.
function start() {
console.log("Done Loading");
}
grepojs.load(start);
Change Data URL
grepojs.WorldDataUrl = "https://us71.grepolis.com/data/";
FAQs
Grepolis api for node.js
The npm package grepolis-js receives a total of 14 weekly downloads. As such, grepolis-js popularity was classified as not popular.
We found that grepolis-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.