package com.techcavern.wavetact.ircCommands.fun;

import com.techcavern.wavetact.annot.IRCCMD;
import com.techcavern.wavetact.objects.IRCCommand;
import com.techcavern.wavetact.utils.GeneralUtils;
import com.techcavern.wavetact.utils.IRCUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.pircbotx.Channel;
import org.pircbotx.PircBotX;
import org.pircbotx.User;

@IRCCMD
public class Quote extends IRCCommand {

    public Quote() {
        super(GeneralUtils.toArray("quote randquote"), 0, "quote", "Gets a random quote", false);
    }

    @Override
    public void onCommand(User user, PircBotX network, String prefix, Channel channel, boolean isPrivate, int userPermLevel, String... args) throws Exception {
        Document doc = Jsoup.connect("http://wwww.quotationspage.com/random.php3").get();
        String c = doc.select(".quote").get(0).text();
        String d = doc.select(".author").get(0).text();
        IRCUtils.sendMessage(user, network, channel, c +" -" + d, prefix);
    }
}

@@ -233,24 +233,69 @@
 s.IRCUtils;%0A
+import org.apache.commons.lang3.StringUtils;%0A
 import org.j
@@ -967,32 +967,193 @@
 .get(0).text();%0A
+        if(d.contains(%22-%22))%7B%0A            if(!d.contains(%22(%22))%0A            d = d.split(%22-%22)%5B0%5D;%0A            else%0A                d = d.split(%22%5C%5C(%22)%5B0%5D;%0A        %7D%0A
         IRCUtils

Fix Quote Formatting