I'm trying to set up a RSS for my site. So I would like to make a link that takes in a keyword and produces a RSS feed.
I have a python script (script.py
) to generate this xml, but I don't know how to run it and serve the text to the user when my page is called.
Essentially I would like to have someone visit mysite.com/<keyword>
and be served the text generated in script.py
I can make the text appear to the user by simply running javascript, but this isn't being picked up by the rss.
<html>
<head>
<title>Run Python Script</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<script>
$.ajax({
method: "POST",
url: "/script.py",
})
.done(function( response ) {
var newXML = document.open("text/xml", "replace");
newXML.write(response);
newXML.close();
});
</script>
</body>
</html>
It seams like there should be some way of generating this text and serving it to the user, but I feel like I'm just missing something obvious
I'm using godaddy and cpanel if that helps
public_html/cgi-bin
folder and make sure there was a.htaccess
file, still working on taking in parameter<keyword>
. See stackoverflow.com/questions/4939067/…