Skip to content

Instantly share code, notes, and snippets.

@NotArchon
Created May 1, 2023 19:16
Show Gist options
  • Save NotArchon/c0a2c2e10cd0890d963cb70ddb155e87 to your computer and use it in GitHub Desktop.
Save NotArchon/c0a2c2e10cd0890d963cb70ddb155e87 to your computer and use it in GitHub Desktop.
package com.neox.web.model.voting.callbacks;
import com.neox.web.model.voting.VotingCallback;
import java.util.Map;
public class TopG extends VotingCallback {
private static final String SITE_ID = ""; // todo
public TopG() {
super("topg", 12, "monitor.topg.org");
}
@Override
public String getSiteLink(String userId) {
return "https://topg.org/CATEGORY/in-" + SITE_ID + "-" + userId;
}
@Override
public void process(Map<String, String> params, String post) {
String uid = params.getOrDefault("p_resp", null);
if(uid == null)
throw new IllegalStateException("missing voter uid");
String ip = params.getOrDefault("ip", null);
if(ip == null)
throw new IllegalStateException("missing voter ip");
queue(uid, ip);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment