TopSite VIP required (€5) for Postback API and custom banner. Free listings still get votes — the rewards API is VIP-only.
- Buy VIP on Edit listing, then open the Postback box.
- Copy your SecretKey (keep it private).
- Pull API (cron every 1–5 min):
https://forum.evana.cc/topsites/postback?SecretKey=YOUR_KEY
- Optional query flags:
&claim=0 peek without marking claimed · &username=CharName check one player (12h window).
- Push (optional): set an HTTPS URL — on each vote we POST form fields
user, ip, timestamp, signature. Respond with plain text SUCCESS.
Push signature = HMAC-SHA256 of lines ip=… + timestamp=… + user=… (sorted keys, joined by newline) using SecretKey.
PHP — pull + rewardcron / CLI
<?php
declare(strict_types=1);
$key = 'YOUR_SECRET'; // from Edit → Postback
$api = 'https://forum.evana.cc/topsites/postback?SecretKey=' . rawurlencode($key);
$ch = curl_init($api);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => ['Accept: application/json'],
]);
$raw = curl_exec($ch);
$code = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($raw === false || $code !== 200) {
fwrite(STDERR, "Postback failed HTTP {$code}\n");
exit(1);
}
$data = json_decode($raw, true);
if (!($data['ok'] ?? false)) {
fwrite(STDERR, ($data['error'] ?? 'unknown') . "\n");
exit(1);
}
foreach ($data['votes'] ?? [] as $v) {
$user = (string) ($v['username'] ?? '');
$ip = (string) ($v['ip'] ?? '');
if ($user === '') continue;
// giveReward($user, $ip); // your game DB / cash shop
echo "Rewarded {$user} from {$ip}\n";
}
PHP — push endpointrespond SUCCESS
<?php
declare(strict_types=1);
$secret = 'YOUR_SECRET';
$user = (string) ($_POST['user'] ?? '');
$ip = (string) ($_POST['ip'] ?? '');
$ts = (string) ($_POST['timestamp'] ?? '');
$sig = (string) ($_POST['signature'] ?? '');
$payload = ['ip' => $ip, 'timestamp' => $ts, 'user' => $user];
ksort($payload);
$base = [];
foreach ($payload as $k => $v) { $base[] = $k . '=' . $v; }
$expect = hash_hmac('sha256', implode("\n", $base), $secret);
if (!hash_equals($expect, $sig) || $user === '') {
http_response_code(403);
echo 'FAIL';
exit;
}
// giveReward($user, $ip);
header('Content-Type: text/plain');
echo 'SUCCESS';
Node.js — pullESM
import crypto from 'node:crypto';
const key = 'YOUR_SECRET';
const url = `https://forum.evana.cc/topsites/postback?SecretKey=${encodeURIComponent(key)}`;
const res = await fetch(url, { headers: { Accept: 'application/json' } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
if (!data.ok) throw new Error(data.error || 'postback error');
for (const v of data.votes || []) {
const user = String(v.username || '');
const ip = String(v.ip || '');
if (!user) continue;
// await giveReward(user, ip);
console.log(`Rewarded ${user} (${ip})`);
}
Node.js — push verifyExpress
import express from 'express';
import crypto from 'node:crypto';
const app = express();
app.use(express.urlencoded({ extended: false }));
const SECRET = 'YOUR_SECRET';
app.post('/api/evana-vote', async (req, res) => {
const user = String(req.body.user || '');
const ip = String(req.body.ip || '');
const timestamp = String(req.body.timestamp || '');
const signature = String(req.body.signature || '');
const payload = { ip, timestamp, user };
const base = Object.keys(payload).sort()
.map((k) => `${k}=${payload[k]}`).join('\n');
const expect = crypto.createHmac('sha256', SECRET).update(base).digest('hex');
if (!user || !crypto.timingSafeEqual(Buffer.from(expect), Buffer.from(signature))) {
return res.status(403).type('text').send('FAIL');
}
// await giveReward(user, ip);
res.type('text').send('SUCCESS');
});
app.listen(3000);
C++ — pull (libcurl + nlohmann/json)
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include <string>
#include <iostream>
static size_t write_cb(char* p, size_t s, size_t n, void* u) {
auto* out = static_cast<std::string*>(u);
out->append(p, s * n);
return s * n;
}
int main() {
const std::string key = "YOUR_SECRET";
const std::string url =
"https://forum.evana.cc/topsites/postback?SecretKey=" + key; // url-encode in production
CURL* curl = curl_easy_init();
std::string body;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15L);
CURLcode rc = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (rc != CURLE_OK) return 1;
auto j = nlohmann::json::parse(body);
if (!j.value("ok", false)) return 1;
for (auto& v : j["votes"]) {
std::string user = v.value("username", "");
std::string ip = v.value("ip", "");
if (user.empty()) continue;
// GiveReward(user, ip);
std::cout << "Rewarded " << user << "\n";
}
}
Rotate SecretKey from Edit if it leaks. Non-VIP SecretKeys return 403. Votes are claimed after a successful pull unless you use claim=0.