The following script will allow you to use PocketCast with the Distorted View Superfreak Sideshow RSS feed. Simply plug it in to a Webscript.io endpoint with your username and password and point PocketCast at it.
Created
May 26, 2015 04:31
-
-
Save amussey/a2bb1e91ff64811b6aef to your computer and use it in GitHub Desktop.
Distorted View Webscript.io PocketCast Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feed = "http://www.superfreaksideshow.com/members3/wp-content/plugins/s2member-files/s2member-file-inline/s2member-file-remote/podcast.xml" | |
username = "USERNAME" | |
password = "PASSWORD" | |
function url_encode(str) | |
if (str) then | |
str = string.gsub (str, "\n", "\r\n") | |
str = string.gsub (str, "([^%w %-%_%.%~])", | |
function (c) return string.format ("%%%02X", string.byte(c)) end) | |
str = string.gsub (str, " ", "+") | |
end | |
return str | |
end | |
encoded_pass, _ = (url_encode(username) .. ":" .. url_encode(password) .. "@www.superfreaksideshow.com"):gsub("%%", "%%%%") | |
encoded_pass_enclosure, _ = ("enclosure url=\"http://" .. url_encode(username) .. ":" .. url_encode(password) .. "@www.superfreaksideshow.com"):gsub("%%", "%%%%") | |
password_encoded_url, _ = feed:gsub("www.superfreaksideshow.com", encoded_pass) | |
local dv_feed = http.request { | |
url = password_encoded_url | |
} | |
dv_feed, _ = dv_feed.content:gsub("enclosure url=\"http://www.superfreaksideshow.com", encoded_pass_enclosure) | |
return dv_feed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment