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

epool/pikmail

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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("eduardo.alejandro.pool.ake@gmail.com").blockingGet();
profile.getProfilePictureUrl();
profile.resizeProfilePictureUrl(500);
profile.getNickname();
// OR
Pikmail.getProfilePictureUrl("eduardo.alejandro.pool.ake@gmail.com", null).blockingGet();
Pikmail.getProfilePictureUrl("eduardo.alejandro.pool.ake@gmail.com", 500).blockingGet();
Pikmail.getProfileNickname("eduardo.alejandro.pool.ake@gmail.com").blockingGet();
Kotlin
val profile = Pikmail.getProfile("eduardo.alejandro.pool.ake@gmail.com").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("eduardo.alejandro.pool.ake@gmail.com")
        .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("eduardo.alejandro.pool.ake@gmail.com")
        .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