@@ -0,0 +1,1479 @@
+package com.itay.ninegag;%0A%0Aimport java.util.HashMap;%0A%0Aimport org.jsoup.Jsoup;%0Aimport org.jsoup.nodes.Document;%0Aimport org.jsoup.nodes.Element;%0Aimport org.jsoup.select.Elements;%0A%0Apublic class NineGag %7B%0A%09%0A%09private static final String WEBSITE = %22http://9gag.com%22;%0A%09private static final String FRESH = %22/fresh%22;%0A%09%0A%09public enum Sections %7B%0A%09%09FRESH(%22/%22),%0A%09%09XMAS(%22/xmas%22),%0A%09%09FUNNY(%22/funny%22),%0A%09%09NSFW(%22/nsfw%22),%0A%09%09WTF(%22/wtf%22),%0A%09%09GIF(%22/gif%22),%0A%09%09GEEKY(%22/geeky%22),%0A%09%09MEME(%22/meme%22),%0A%09%09CUTE_ANIMALS(%22/cute%22);%0A%09%09%0A%09%09private String link;%0A%09%09%0A%09%09private Sections(String link) %7B%0A%09%09%09this.link = link;%0A%09%09%7D%0A%09%09%0A%09%09public String getLink() %7B%0A%09%09%09return link;%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static HashMap%3CString, String%3E getNewPosts(HashMap%3CString, String%3E found, Sections section) throws Exception %7B%0A%09%09if(found == null) throw new IllegalArgumentException(%22found can not be null!%22);%0A%09%09HashMap%3CString, String%3E newFound = found;%0A%09%09Document doc = Jsoup.connect(WEBSITE + section.getLink() + FRESH).userAgent(%229gag-coutner$%22 + section).get();%0A%09%09int count = found.size() - 9;%0A%09%09Elements posts = doc.select(%22.badge-entry-container, .badge-entry-entity%22);%0A%09%09for(Element element : posts) %7B%0A%09%09%09String id = element.attr(%22data-entry-id%22);%0A%09%09%09if(!newFound.containsKey(id)) %7B%0A%09%09%09%09if(count %3E 0) %7B%0A%09%09%09%09%09print(%22(9gag-counter$%22 + section + %22)%22 + id + %22 Was added to the list %7C %22 + count);%0A%09%09%09%09%7D%0A%09%09%09%09count++;%0A%09%09%09%09newFound.put(id, %22post%22);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return newFound;%0A%09%7D%0A%09%0A%09private static void print(String s) %7B%0A%09%09System.out.println(s);%0A%09%7D%0A%09%0A%7D%0A

Create NineGag.java