Last active
June 25, 2016 00:01
-
-
Save rye761/b0bc708e8d05b66c747eabfdd3a32069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import com.github.rye761.unsplash.Category; | |
import com.github.rye761.unsplash.Photo; | |
import com.github.rye761.unsplash.Stats; | |
import com.github.rye761.unsplash.Unsplash; | |
import java.util.HashMap; | |
public class TestOAuth { | |
public static void main(String[] args) { | |
HashMap<String, String> config = new HashMap<>(); | |
config.put("applicationId", "your_appid"); | |
config.put("secret", "your_secret"); | |
config.put("callbackUrl", "urn:ietf:wg:oauth:2.0:oob"); | |
Unsplash.getInstance().init(config); | |
Stats stats = Stats.total(); | |
System.out.println(Integer.toString(stats.photoDownloads)); | |
for (Category cat : Category.all()) { | |
System.out.println(cat.title); | |
System.out.println(cat.links.self); | |
} | |
Photo[] photos = Photo.all(); | |
System.out.println(photos[0].urls.raw); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment