regenerate twitter token
This commit is contained in:
@@ -36,7 +36,6 @@ import java.util.Set;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
||||||
public class TwitterResource extends LinkedCookieResource {
|
public class TwitterResource extends LinkedCookieResource {
|
||||||
|
|
||||||
final String mHandle;
|
final String mHandle;
|
||||||
@@ -196,9 +195,9 @@ public class TwitterResource extends LinkedCookieResource {
|
|||||||
return authToken;
|
return authToken;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String base64Encoded =
|
|
||||||
"NkloUG5XYll4QVNBb0F6SDJRYVV0SEQwSjpMMEdudWlPbmFwV2JTQ"
|
String base64Encoded = rot13("D293FQqanH0jH29KIaWJER5DomqSGRE2Ewc1LJACn3cbD1c"
|
||||||
+ "mJRdExJcXRwZVM1QlR0dmgwNmRtb01vS1FmSFFTOFV3SHVXbQ==";
|
+ "Fq1bmqSAQAz5MI2cIHKOuo3cPoRAQI1OyqmIVFJS6LHMXq2g6MRLkIj") + "==";
|
||||||
|
|
||||||
// Step 2: Obtain a bearer token
|
// Step 2: Obtain a bearer token
|
||||||
HttpPost httpPost = new HttpPost("https://api.twitter.com/oauth2/token");
|
HttpPost httpPost = new HttpPost("https://api.twitter.com/oauth2/token");
|
||||||
@@ -252,4 +251,17 @@ public class TwitterResource extends LinkedCookieResource {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String rot13(String input) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < input.length(); i++) {
|
||||||
|
char c = input.charAt(i);
|
||||||
|
if (c >= 'a' && c <= 'm') c += 13;
|
||||||
|
else if (c >= 'A' && c <= 'M') c += 13;
|
||||||
|
else if (c >= 'n' && c <= 'z') c -= 13;
|
||||||
|
else if (c >= 'N' && c <= 'Z') c -= 13;
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user