コード例 #1
0
 public void testInstagramAlbums() throws IOException {
   if (!DOWNLOAD_CONTENT) {
     return;
   }
   List<URL> contentURLs = new ArrayList<URL>();
   contentURLs.add(new URL("http://instagram.com/feelgoodincc#"));
   for (URL url : contentURLs) {
     try {
       InstagramRipper ripper = new InstagramRipper(url);
       ripper.rip();
       assert (ripper.getWorkingDir().listFiles().length > 1);
       deleteDir(ripper.getWorkingDir());
     } catch (Exception e) {
       fail("Error while ripping URL " + url + ": " + e.getMessage());
     }
   }
 }
コード例 #2
0
 public void testInstagramGID() throws IOException {
   Map<URL, String> testURLs = new HashMap<URL, String>();
   testURLs.put(new URL("http://instagram.com/Test_User"), "Test_User");
   testURLs.put(new URL("http://instagram.com/_test_user_"), "_test_user_");
   testURLs.put(new URL("http://instagram.com/-test-user-"), "-test-user-");
   testURLs.put(new URL("http://statigr.am/username"), "username");
   for (URL url : testURLs.keySet()) {
     InstagramRipper ripper = new InstagramRipper(url);
     assertEquals(testURLs.get(url), ripper.getGID(ripper.getURL()));
     deleteDir(ripper.getWorkingDir());
   }
 }