Skip to content

Instantly share code, notes, and snippets.

@twilight-sparkle-irl
Last active October 20, 2025 18:42
Show Gist options
  • Select an option

  • Save twilight-sparkle-irl/c2c0e527d7008d7c1d60a31276e50151 to your computer and use it in GitHub Desktop.

Select an option

Save twilight-sparkle-irl/c2c0e527d7008d7c1d60a31276e50151 to your computer and use it in GitHub Desktop.
import/export ponies

only enable one at a time
this only works on computer. you must have tampermonkey installed on your browser

when ponies dumper is on: open console and type dumpPonies()

when ponies changer is on: open your ponies.txt, copy and paste the large chunk of data next to the pony name (and nothing else, no spaces, etc), open console, type window.ponyInfo = "[CODE STRING]", create a new pony, save it, and then type delete window.ponyInfo;

i cannot guarantee this will work cross server, as pony town has not updated the public domain release despite multiple upgrades it's had, causing other servers to need to make replica features or simply not implement them. if you need extra servers, add a // @match https://[server domain]/* line with the pony.town ones

// ==UserScript==
// @name Ponies Changer
// @run-at document-start
// @match https://pony.town/*
// @grant none
// ==/UserScript==
// magic incantation
window.XMLHttpRequest.prototype.addEventListener=((f)=>{return function(){f.apply(this,arguments)}})(window.XMLHttpRequest.prototype.addEventListener)
// actual code
var _ = window.XMLHttpRequest.prototype.send
window.XMLHttpRequest.prototype.send = function() {
var h = arguments[0]
if(this.__zone_symbol__xhrURL.match(/^\/api\/pony\/save/)) {
var x = JSON.parse(h)
if(window.ponyInfo) {
x.pony.info = window.ponyInfo
}
h = JSON.stringify(x)
}
_.apply(this,[h])
}
// ==UserScript==
// @name Ponies Dumper
// @run-at document-start
// @match https://pony.town/*
// @grant none
// ==/UserScript==
// magic incantation
window.XMLHttpRequest.prototype.addEventListener=((f)=>{return function(){f.apply(this,arguments)}})(window.XMLHttpRequest.prototype.addEventListener)
// actual code
var _ = window.XMLHttpRequest.prototype.send
window.XMLHttpRequest.prototype.send = function() {
if(this.__zone_symbol__xhrURL.match(/^\/api([0-9]+)\/account(\?t=(.+))?$/)) {
this.addEventListener('load',function(e) {
window.ponies = JSON.parse(this.responseText).ponies
})
}
_.apply(this,arguments)
}
window.dumpPonies = function dumpPonies() {
var poniesTxt = window.ponies.map(x=>`${x.name}\t${x.info}`).join`\n`
var file = new Blob([poniesTxt], {type: "text/plain"});
var a = document.createElement('a')
a.href = URL.createObjectURL(file);
a.download = "ponies.txt";
a.click()
}
@negnqz208
Copy link

is not working why?

@twilight-sparkle-irl
Copy link
Author

This script is old and hasn't been updated to work on the latest version of PT.

@negnqz208
Copy link

Can you work on it? I think it's really cool.

@t81412850-lab
Copy link

1000041158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment