This file contains 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
<div class=rc> | |
<div class=r> Link </div> | |
<div class=s> | |
<em> Matched Text in Bold </em> | |
</div> | |
</div> |
This file contains 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
public String query(String input) { | |
String query = "https://www.google.com/search?q=\""; | |
String[] ls = input.split(" "); | |
for (String i : ls) { | |
query += i + "+"; | |
} | |
return query + "\""; | |
} |
This file contains 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
void checkPlagiarism(String search) throws IOException { | |
CrawlerQuery gsq = new CrawlerQuery(); | |
Document doc = Jsoup.connect(gsq.query(search)).get(); | |
Elements rc = doc.select("div.rc"); | |
for (Element i : rc) { | |
Elements em = i.select("em"); | |
if ((em.text()).equals(search)) { | |
Element link = i.select("div.r a").first(); | |
System.out.println("Plagiarism detected in: " + search + " \nLink: " + link.attr("href") + "\n"); |