Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.
/ pikmail Public archive

DEPRECATED: Utility for mapping gmail addresses to a basic profile info including profile picture url and nickname.

License

Notifications You must be signed in to change notification settings

epool/pikmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pikmail

DEPRECATED

UPDATE: Since this API was fully based on the Picasa API and that API has been depreated, Therefore this API is being deprecated too unless we found a workaround to this.

This API is being deprecated and will be turned down in January 2019. Migrate to Google Photos Library API as soon as possible to avoid disruptions to your application.

Info Here

================================================================================

This is a utility written in Kotlin that consumes one public picasa endpoint to fetch the google profile picture for the email along with the nickname.

You can read this blog post to know how Pikmail Api works intenally.

Libraries

This project uses the following libraries internally to work.

Development libraries

Testing libraries

  • Spek Used to write some integration tests as specs.

Usage

Dependency

repositories {
    ...
    maven { url 'https://jitpack.io' }
    ...
}

dependencies {
    ...
    implementation "com.github.epool:pikmail:1.0.0"
    ...
}

Blocking

Use it when blocking is safe to use like on web servers.

Java
Profile profile = Pikmail.getProfile("[email protected]").blockingGet();
profile.getProfilePictureUrl();
profile.resizeProfilePictureUrl(500);
profile.getNickname();
// OR
Pikmail.getProfilePictureUrl("[email protected]", null).blockingGet();
Pikmail.getProfilePictureUrl("[email protected]", 500).blockingGet();
Pikmail.getProfileNickname("[email protected]").blockingGet();
Kotlin
val profile = Pikmail.getProfile("[email protected]").blockingGet()
profile.profilePictureUrl
profile.resizeProfilePictureUrl(500)
profile.nickname
// OR
Pikmail.getProfilePictureUrl(email).blockingGet()
Pikmail.getProfilePictureUrl(email, 500).blockingGet()
Pikmail.getProfileNickname(email).blockingGet()

Async

Use it when blocking is not safe to use like on Android main thread.

Java
Pikmail.getProfile("[email protected]")
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread()) // In case you are using it on Android or use any other scheduler you need
        .subscribe(
                new Consumer<Profile>() {
                    @Override
                    public void accept(Profile profile) throws Exception {
                        System.out.println(profile.toString());
                    }
                },
                new Consumer<Throwable>() {
                    @Override
                    public void accept(Throwable throwable) throws Exception {
                        System.out.println(throwable.getCause().toString());
                    }
                }
        );
Kotlin
Pikmail.getProfile("[email protected]")
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(
                { println(it.toString()) },
                { println(it.cause.toString()) }
        )

NOTE: If the profile is not found or if the gmail address is invalid you will receive a ProfileNotFountException. You could take a look on the integrations tests here to get a better idea about how to use the Pikmail api.

About

DEPRECATED: Utility for mapping gmail addresses to a basic profile info including profile picture url and nickname.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages