Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String resolvePhotoUrl(Result result) {
- if (result.getAuthorUrl() == null) {
- return null;
- }
- if (result.getAuthorUrl().startsWith("http://www.facebook.com")) {
- String chunks[] = result.getAuthorUrl().split("id=");
- String profileId = chunks[chunks.length - 1];
- return "https://graph.facebook.com/" + profileId + "/picture?type=small";
- }
- if (result.getAuthorUrl().startsWith("http://instagram.com")) {
- return "https://avatars.io/instagram/" + result.getAuthor();
- }
- if (result.getAuthorUrl().startsWith("http://twitter.com")) {
- return "https://twitter.com/" + result.getAuthor() + "/profile_image?size=bigger";
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement