Advertisement
Mouamle

FunctionsGetter.java

Jul 11th, 2017
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.io.IOException;
  2.  
  3. import org.jsoup.Jsoup;
  4. import org.jsoup.nodes.Document;
  5.  
  6. public class FunctionsGetter {
  7.  
  8.     String wikiUrl = "https://wiki.multitheftauto.com/wiki/";
  9.  
  10.     public FunctionsGetter() {
  11.     }
  12.  
  13.     public String getSyntax(String functionName) throws IOException {
  14.         Document doc = Jsoup.connect(wikiUrl + functionName).validateTLSCertificates(false).get();
  15.         return doc.select(".lang-lua").get(0).text();
  16.     }
  17.    
  18.     public static void main(String[] args) throws Exception {
  19.         FunctionsGetter getter = new FunctionsGetter();
  20.         System.out.println(getter.getSyntax("PlaySound"));
  21.         // outputs : element playSound ( string soundPath, [ bool looped = false, bool throttled = true ] )
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement