2018-01-12 12:50:12 +01:00
|
|
|
package net.Broken.Commands.Over18;
|
2016-12-08 20:05:23 +01:00
|
|
|
|
2018-02-15 00:57:07 +01:00
|
|
|
import net.Broken.Outils.Command.NumberedCommande;
|
2017-02-04 19:31:09 +01:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
2016-12-08 20:05:23 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by seb65 on 07/11/2016.
|
|
|
|
*/
|
2017-03-20 18:36:26 +01:00
|
|
|
public class Pipe extends NumberedCommande {
|
|
|
|
public Pipe() {
|
2017-05-10 21:43:44 +02:00
|
|
|
super(LogManager.getLogger(), "http://feelation.com/","featured-img","img");
|
2016-12-08 20:05:23 +01:00
|
|
|
}
|
|
|
|
|
2017-03-20 18:36:26 +01:00
|
|
|
/*
|
|
|
|
System.out.println("ok");
|
2017-02-08 23:53:50 +01:00
|
|
|
String pipeLine=null;
|
|
|
|
URL pipeURL = new URL(redirect.get("http://feelation.com/random"));
|
|
|
|
URLConnection cc = pipeURL.openConnection();
|
|
|
|
BufferedReader in = new BufferedReader(new InputStreamReader(cc.getInputStream(), "UTF-8"));
|
|
|
|
String inputLine;
|
|
|
|
|
|
|
|
|
|
|
|
while ((inputLine = in.readLine()) != null)
|
|
|
|
{
|
|
|
|
System.out.println(inputLine);
|
|
|
|
if(inputLine.contains("class=\"post photo\""))
|
|
|
|
{
|
|
|
|
String[] splited = inputLine.split("<");
|
|
|
|
for(String aString:splited)
|
|
|
|
{
|
|
|
|
if(aString.startsWith("<img src"))
|
|
|
|
{
|
|
|
|
pipeLine=aString;
|
|
|
|
pipeLine=inputLine.replaceAll("<img src=\"","");
|
|
|
|
pipeLine=pipeLine.substring(0,pipeLine.indexOf("\""));
|
|
|
|
System.out.println(pipeLine);
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
in.close();
|
2016-12-08 20:05:23 +01:00
|
|
|
event.getTextChannel().sendMessage(redirect.get("http://feelation.com/random")).queue();
|
2017-03-20 18:36:26 +01:00
|
|
|
*/
|
2017-03-20 21:01:49 +01:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Pipe";
|
|
|
|
}
|
2017-09-05 02:13:27 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isPrivateUsable() {
|
|
|
|
return false;
|
|
|
|
}
|
2016-12-08 20:05:23 +01:00
|
|
|
}
|