(Also, I kinda wish when people break links they’d just break them in one place, its kind of annoying to play “find the space” and once its broken once, I don’t think making it “more broken” adds any extra protection)
And there’s an easier way to work it - just post the link as normal, but inside [noparse] tags. I went back and edited the URL so there are no spaces and can just be copied and pasted into a browser.
Finally that Java class is good for something. Behold the program I just made. Paste the broken link into the “Add URL” field, click “Remove spaces”, then “Go to URL” to get to your website.
public class URLSpaceRemover extends JFrame implements ActionListener{
private static final long serialVersionUID = 1L;
private JLabel jlAddURL = new JLabel(“Add URL”);
private JTextField tfAddURL= new JTextField(“”, 350);
private JLabel jlCorrectedURL = new JLabel(“Corrected URL”);
private JTextField tfCorrectedURL= new JTextField(“”, 350);
private JButton btRemoveSpace= new JButton("Remove Spaces");
private JButton btGoToLink= new JButton("Go to URL");
final JPopupMenu cutpasteMenu = new JPopupMenu();
JMenuItem cutMenuItem = new JMenuItem("Cut");
JMenuItem copyMenuItem = new JMenuItem("Copy");
JMenuItem pasteMenuItem = new JMenuItem("Paste");
public URLSpaceRemover() {
setTitle("URL space remover");
setSize(550, 180);
setLocation (300, 100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setComponents();
}
private void setComponents() {
Container contents= this.getContentPane();
contents.setLayout(null);
tfAddURL.setEditable(true);
tfCorrectedURL.setEditable(false);
tfAddURL.setBounds(10,30,350,25);
tfCorrectedURL.setBounds(10,80,350,25);
jlAddURL.setBounds(10,5,100,25);
jlCorrectedURL.setBounds(10,55,100,25);
btRemoveSpace.setBounds(370,30,145,25);
btGoToLink.setBounds(370,80,145,25);
contents.add(tfAddURL);
contents.add(tfCorrectedURL);
contents.add(jlCorrectedURL);
contents.add(jlAddURL);
contents.add(btRemoveSpace);
contents.add(btGoToLink);
cutMenuItem.addActionListener(this);
copyMenuItem.addActionListener(this);
pasteMenuItem.addActionListener(this);
cutpasteMenu.add(cutMenuItem);
cutpasteMenu.add(copyMenuItem);
cutpasteMenu.add(pasteMenuItem);
tfAddURL.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
switch(e.getModifiers()) {
case InputEvent.BUTTON3_MASK: {
cutpasteMenu.show(e.getComponent(), e.getX(), e.getY());
break;
}
}
}
});
btRemoveSpace.addActionListener(new RemoveSpace());
btGoToLink.addActionListener(new GoToURL());
}
class RemoveSpace implements ActionListener
{
public void actionPerformed(ActionEvent arg0) {
String fixURL= tfAddURL.getText();
if(fixURL !=null && !fixURL.equalsIgnoreCase(""))
{
fixURL = fixURL.replace(" ", "");
fixURL= fixURL.toLowerCase();
if(!fixURL.contains("https://"))
{
if(!fixURL.contains("http://"))
{
if(!fixURL.contains("www."))
{
fixURL="http://"+fixURL;
tfCorrectedURL.setText(fixURL);
}else if (fixURL.contains("www."))
{
tfCorrectedURL.setText(fixURL);
}
}else
tfCorrectedURL.setText(fixURL);
}else
tfCorrectedURL.setText(fixURL);
}
}
}
class GoToURL implements ActionListener
{
public void actionPerformed(ActionEvent arg0) {
String link= tfCorrectedURL.getText();
if(!link.equalsIgnoreCase(""))
{
URI uri;
try {
uri = new URI(link);
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(uri);
} catch (IOException e) { /* TODO: error handling */ }
}
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
public void actionPerformed(ActionEvent evt) {
Object source = evt.getSource();
if (source == cutMenuItem) {
JTextField jte = (JTextField)cutpasteMenu.getInvoker();
jte.cut();
}
if (source == copyMenuItem) {
JTextField jte = (JTextField)cutpasteMenu.getInvoker();
jte.copy();
}
if (source == pasteMenuItem) {
JTextField jte = (JTextField)cutpasteMenu.getInvoker();
jte.paste();
}
}
public static void main(String[] args) {
URLSpaceRemover run = new URLSpaceRemover();
run.setVisible(true);
}
Yes, and I was pointing out that you posted the link already. Although you posted the correct link (to Funny or Die) not the youtube link which has since been pulled.
I know! Don’t tease us like that, jerkass! :shakes fist:
But I should have known better. Kirk is one of those freakshows who I don’t think is some closet kiddy diddler or meth head. I think he takes his shit 100% seriously, and probably never bangs his wife on Sundays because it feels unholy. Remember all those girls who had crushes on him? LOL.
Good Jesus, and he apparently sells the shit out of his DVDs too. Who would… I mean why… Okay, look, even if I were a Jesus freak and the kind of person to let a seminar tell me what to do with my marriage, why the hell would I listen to Kirk Cameron?