Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<!--
Works around G+ 403 errors like these:
https://ipv4.google.com/sorry/IndexRedirect?continue=https://plus.google.com/u/0/%2Bcodeproject/posts/FQCEnGxYGXi&q=CGMSBLzJ3TkY7vzttwUiGQDxp4NLeVHCwZCj8IDRjkFp5Wevt5na1f4qOmh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rY29kZXByb2plY3QvcG9zdHMvRlFDRW5HeFlHWGk
403. That’s an error.
Your client does not have permission to get URL /sorry/IndexRedirect?continue=https://plus.google.com/u/0/%2Bcodeproject/posts/FQCEnGxYGXi&q=CGMSBLzJ3TkY7vzttwUiGQDxp4NLeVHCwZCj8IDRjkFp5Wevt5na1f4qOmh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rY29kZXByb2plY3QvcG9zdHMvRlFDRW5HeFlHWGk from this server. That’s all we know.
source https://ipv4.google.com/sorry/IndexRedirect?continue=https://plus.google.com/u/0/%2Bcodeproject/posts/FQCEnGxYGXi&q=CGMSBLzJ3TkY7vzttwUiGQDxp4NLeVHCwZCj8IDRjkFp5Wevt5na1f4qOmh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rY29kZXByb2plY3QvcG9zdHMvRlFDRW5HeFlHWGk
target https://plus.google.com/u/0/+codeproject/posts/FQCEnGxYGXi
source https://ipv4.google.com/sorry/IndexRedirect?continue=https://plus.google.com/u/0/%2BLyndaHecht/posts/fSSXh96rcLi&q=CGMSBLzJ3TkY7vzttwUiGQDxp4NL-KfC7ZN3j6E2rFd4pZYndOXSbvYqOWh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rTHluZGFIZWNodC9wb3N0cy9mU1NYaDk2cmNMaQ
target https://plus.google.com/u/0/+LyndaHecht/posts/fSSXh96rcLi
-->
<html>
<body>
<h1>Work around G+ "403. That’s an error." errors</h1>
<p>Please enter the Google 403 error URL:</p>
<input id="googlePlus403Url">
<button type="button" onclick="decodeGooglePlus403UrlMethod()">Submit</button>
<div id="decodedUrlsCaptionDiv">
<p id="decodedUrlsCaption">Here you will see the decoded Google Plus URLs so you can follow them:</p>
</div>
<ul id="decodedUrlsUl">
</ul>
<script>
// based on http://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_validate
function decodeGooglePlus403UrlMethod() {
var googlePlusUrl = "";
var errorText = "";
// Get the value of the input field with id="numb"
var googlePlus403Url = document.getElementById("googlePlus403Url").value;
var stripPrefix = "https://ipv4.google.com/sorry/IndexRedirect?continue=";
var prefix = stripPrefix + "https://plus.google.com";
var suffixStart = "&q=";
// now skip anything until the suffixStart, so we kill `CGMSBLzJ3TkY7vzttwUiGQDxp4NL-KfC7ZN3j6E2rFd4pZYndOXSbvYqOWh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rTHluZGFIZWNodC9wb3N0cy9mU1NYaDk2cmNMaQ`
// Am I a SO developer now? At least I'm quickly learning some JavaScript basics...
// http://stackoverflow.com/questions/1767246/check-if-string-begins-with-something/9430330#9430330
// http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character#comment13999010_10767815
if (googlePlus403Url.indexOf(prefix) == 0) {
var lastSuffixStartIndex = googlePlus403Url.lastIndexOf(suffixStart);
if (lastSuffixStartIndex == -1) {
errorText = "SuffixStart missing in URL";
} else {
// now strip the bits we don't need, then decode what is left.
// I always wondered why they call it substring instead of subString
var googlePlusEncodedUrl = googlePlus403Url.substring(stripPrefix.length, lastSuffixStartIndex);
// decoding got a new new a while ago: http://stackoverflow.com/questions/4292914/javascript-url-decode-function/4292961#4292961
googlePlusUrl = decodeURIComponent(googlePlusEncodedUrl);
};
} else {
errorText = "Wrong prefix in URL";
};
// for now, just add the output; in the future, only add unique output.
// Based on http://stackoverflow.com/questions/5519747/how-to-add-anchor-tags-dynamically-to-a-div-in-javascript/5519795#5519795
var decodedUrlsUl = document.getElementById("decodedUrlsUl");
var decodedUrlLi = document.createElement('li');
if (errorText == ""){
var aTag = document.createElement('a');
aTag.setAttribute('href', googlePlusUrl);
aTag.innerHTML = googlePlusUrl;
decodedUrlLi.appendChild(aTag);
} else {
var aDiv = document.createElement('div');
aDiv.innerHTML = errorText + " " + googlePlus403Url;
decodedUrlLi.appendChild(aDiv);
}
decodedUrlsUl.appendChild(decodedUrlLi);
}
</script>
</body>
</html>
@jpluimers

This comment has been minimized.

Copy link
Owner Author

commented Aug 18, 2016

Adopt for chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/suspended.html#url=http%3A%2F%2Fdocwiki.embarcadero.com%2FRADStudio%2FSeattle%2Fen%2FPackage_Files_Created_by_Compiling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.