View difference between Paste ID: qkZfWrmM and W9Mf6ysB
SHOW: | | - or go back to the newest paste.
1
class Heroku{
2
	public List<Post> unpublished;
3
	
4
	public List<Post> getUnpublished(){
5
		Firebase fbase = new Firebase (FBASE_URL);
6
7
		ref.addChildEventListener(new ChildEventListener() {			
8
			// Retrieve new posts as they are added to Firebase
9
			@Override
10
			public void onChildAdded(DataSnapshot snapshot, String previousChildKey) {
11
				Map<String, Object> newPost = (Map<String, Object>) snapshot.getValue();
12
				// push to unpublished like newpost.get...
13
			}
14
		}
15
		try {
16
		    Thread.sleep(1000);                 //1000 milliseconds is one second.
17
		} catch(InterruptedException ex) {
18
		    Thread.currentThread().interrupt();
19
		}
20
		retun unpublished;
21
	}
22
}