Open the browser to http://codegolf.stackexchange.com

34

5

Your job is to open a browser window of the default browser to http://codegolf.stackexchange.com.

Your code must open the browser itself, and cannot rely on an open one.

This is , so the shortest answer in bytes wins.

noɥʇʎԀʎzɐɹƆ

Posted 2016-03-30T14:57:12.053

Reputation: 1 316

9Are URL shorteners allowed? – isaacg – 2016-03-30T15:01:46.707

1@isaacg I'm assuming "yes", since the OP used ppcg.lol themselves in a now deleted answer. – Martin Ender – 2016-03-30T15:21:49.457

3@issacg Yes, it is allowed. – noɥʇʎԀʎzɐɹƆ – 2016-03-30T15:26:22.917

4Is it allowed to run JavaScript in the default browser to open a window? – Mwr247 – 2016-03-30T15:30:20.120

4@Mwr247 No, it is not. – noɥʇʎԀʎzɐɹƆ – 2016-03-30T15:49:58.490

15You should add clarifications/restrictions to the question itself, since comments are not guaranteed to stick around forever. – Mego – 2016-03-30T16:01:29.047

This question has received 20 votes (according to my reputation tab) that add up to 2. There must be a lot of controversy. – noɥʇʎԀʎzɐɹƆ – 2016-03-30T16:45:46.417

8Your spec is minimal, which led to alot of uncertainty over what is allowed to accomplish the task. Additionally, some probably consider it a trivial task. Still, you're in the positive ;) – Mwr247 – 2016-03-30T17:16:10.083

Are you banning the language JavaScript? – wizzwizz4 – 2016-03-30T17:44:05.277

@wizzwizz4 No, the restriction is to prevent running code in an already-open browser, which is a loophole that would trivialize the challenge. A better rule would be that the code must work without any browser processes open. – Mego – 2016-03-30T18:54:55.033

3I am voting to close as unclear because there have been too many answers trying to exploit the only partially-closed loophole of running code in a browser process. The extremely minimal spec leaves too much room for abuse. – Mego – 2016-03-30T20:00:29.180

I'm assuming buying an even smaller domain to use is a loophole? – Quill – 2016-03-30T22:55:42.517

@Quill Nope, because other people can use it too. Feel free to do it! – noɥʇʎԀʎzɐɹƆ – 2016-03-30T22:56:31.160

Dear close-voters: there is a lot of controversy over this question. According to reputation changes, I have receive >20 down votes. However, there is a positive difference of 13 with means the community is generally acceptant of question. – noɥʇʎԀʎzɐɹƆ – 2016-03-31T13:21:01.393

1

Solution in one byte: .

– Paul Gaborit – 2016-03-31T14:37:07.790

3

@CrazyPython That's not entirely true. According to our BDFL, Jeff Attwood, downvotes are rare. Right now it's at -21/+34. And a positive score is not an argument in favor of leaving a question open, for example this challenge.

– James – 2016-03-31T16:39:15.610

1

See vim's gx command. Works with the cursor over the text ppcg.lol in normal mode. Not sure how many byte that would count as.

– Michael Plotke – 2016-03-31T18:41:17.020

@PaulGaborit in what language? – Rɪᴋᴇʀ – 2016-03-31T22:47:17.843

Notice just as many reopen votes ad close votes before it was closed. – noɥʇʎԀʎzɐɹƆ – 2016-04-01T00:00:47.787

@EasterlyIrk One visible byte (with some invisible bytes) in comment language used here. – Paul Gaborit – 2016-04-01T05:34:59.320

http://ppcg.ga/ should be active soonish. – Tim – 2016-04-01T16:29:45.690

@CrazyPython Note that everyone with enough rep to close vote has enough rep to view the upvote/downvote totals. http://codegolf.stackexchange.com/help/privileges

– Justin – 2016-04-02T22:02:03.807

Please note that ppcg.ga no longer works, and URL-shorteners are a loophole now, though allowed for this challenge. https://codegolf.meta.stackexchange.com/a/11971/34718

– mbomb007 – 2017-04-03T19:29:15.723

1I'm voting to close this question as off-topic because the URL-shortener (ppcg.ga) used in most of the answers no longer works. This means old answers have been invalidated, and new ones using the same thing wouldn't work. – mbomb007 – 2017-04-03T19:53:29.243

Answers

36

 GNU Emacs, 29 27 14 bytes

(eww"ppcg.ga")

EWW is a browser inside Emacs. The browse-web function is an alias for eww, and so that makes eww the default browser in Emacs:

Your job is to open a browser window of the default browser to http://codegolf.stackexchange.com.

Thanks to @CoolestVeto, @Jonathan Leech-Pepin and @zyabin101.

coredump

Posted 2016-03-30T14:57:12.053

Reputation: 6 292

Can you use www.ppcg.lol instead of http://ppcg.lol? – AdmBorkBork – 2016-03-30T15:55:44.600

1@TimmyD No, at first I tried with "www" but the protocol must be supplied (the behavior is different for example with "mailto://"). For user interaction, there is "browse-url-at-point" which prepends "http", but this is longer of course. – coredump – 2016-03-30T16:47:18.593

You shouldn't need the //, I don't think. (I don't use emacs, but it's generally accepted without the //) – Addison Crump – 2016-03-30T19:03:54.697

@CoolestVeto Correct, thanks – coredump – 2016-03-30T20:47:24.267

Arguably this could be shortened to (eww"ppcg.lol") sinceeww is now the default browser for Emacs itself. (browse-web is an alias for eww in the menu bar) – Jonathan Leech-Pepin – 2016-03-31T12:34:49.690

@JonathanLeech-Pepin I didn't know, many thanks. – coredump – 2016-03-31T12:57:02.817

12ಠ_ಠ PPCG is not something to "ewwww" that, that's code review :P – Downgoat – 2016-04-12T02:01:13.450

3

Apparently there is http://ppcg.ga. It may save you a byte.

– user48538 – 2016-04-29T16:15:41.903

@zyabin101 Thanks, edited. – coredump – 2016-04-29T16:42:52.357

It says URL shorteners aren't allowed.. – None – 2016-07-26T23:35:18.710

46

Oration, 41 bytes

Not winning, but sure was fun. As of right now, I'm only 1 bytee behind python!

I need webbrowser
Now open "http:ppcg.ga"

Explanation:

I need compiles to import $1 with webbrowser being the module.

Now runs the following command from the module as module.command with the arguments of anything following.

So this compiles to:

#!/usr/bin/env python3
import webbrowser
webbrowser.open("http:ppcg.ga")

I do end up needing the http: part though, and it can't be shortened.

Rɪᴋᴇʀ

Posted 2016-03-30T14:57:12.053

Reputation: 7 410

17

As the owner of http://ppcg.lol, I approve of this message.

– Quill – 2016-03-30T16:13:46.700

This conversation has been moved to chat.

– Dennis – 2016-03-30T17:40:19.820

I'm almost certain that you can replace "http://ppcg.lol" with "http:ppcg.lol". I'm uncertain whether you can remove the space between open and "http:...", but try it? – Addison Crump – 2016-03-30T19:01:58.063

@Quill Is that from a url shortener, or did you just decide to buy ppcg.lol (and how do we know you won't use your powers for evil?) – PyRulez – 2016-03-30T22:33:37.653

@PyRulez I decided to buy the domain, and all the subdomains and main domains are direct DNS level redirects, if you don't believe me, you can use a packet analyser like Charles or even chrome's chrome://net-internals to see there's no malicious data being sent. – Quill – 2016-03-30T22:39:22.553

2@Quill I meant how do we know you won't Rick roll us all at some future point? – PyRulez – 2016-03-30T23:55:18.613

@PyRulez I actually use the shortcut, that would suck for me – Quill – 2016-03-31T00:00:08.670

1@Quill that depends on how much you like Rick... – TMH – 2016-04-01T15:35:02.743

43

Batch, 17 bytes

Saved 3 bytes thanks to Mego.

start www.ppcg.ga

This will open in your default browser if you run it from the windows command line.

I think it'll work in Powershell too, but I'm not sure.

Morgan Thrapp

Posted 2016-03-30T14:57:12.053

Reputation: 3 574

3You can use start instead of explorer. – Mego – 2016-03-30T15:07:54.287

8You can use start www.ppcg.lol instead to implicitly have Windows parse it as HTTP. Works in both CMD and PowerShell. – AdmBorkBork – 2016-03-30T15:37:08.517

Also works in Wine on Linux and OSX – cat – 2016-03-30T16:19:54.450

1It gets 1 byte shorter in PowerShell – Matt – 2016-03-30T20:13:59.463

@Matt Nice! I should really learn more PowerShell. – Morgan Thrapp – 2016-03-30T20:16:19.867

2Why do you need the www.? – Blender – 2016-03-30T20:26:15.487

3@Blender Because otherwise it tries to find a local program called pccg with the .lol file extension and run it. – Morgan Thrapp – 2016-03-30T20:27:13.427

What url shortener did you use? – PyRulez – 2016-03-30T22:30:12.730

@pyrulez Whichever one everyone else was using. – Morgan Thrapp – 2016-03-30T22:30:52.997

2@PyRulez It's not a URL shortener, technically. Quill bought that domain a while back and set up a DNS redirect. – Mego – 2016-03-31T06:21:30.293

@MDXF When I made the comment, it was referring to ppcg.lol, which was indeed purchased by Quill. – Mego – 2017-07-26T05:03:13.117

24

PowerShell, 17 16 Bytes

saps www.ppcg.lol 

Using an even shorter domain provided by Milo.

saps www.ppcg.ga

While start is a known alias for Start-Process there is another one for saps. You can see this from Get-Alias. It follows the convention for similar Start- and Stop- cmdlets.

Matt

Posted 2016-03-30T14:57:12.053

Reputation: 1 075

psst you can use www.ppcg.ga now – Milo – 2016-04-03T02:49:51.180

@Milo Thanks. I think other people can hear you. – Matt – 2016-04-03T06:35:31.177

http://www.ppcg.ga/ not working – anukul – 2016-04-03T13:16:54.560

2Hmm. Still works for me and I will presume milo. Perhaps it is new and dns has not fully propogated – Matt – 2016-04-03T14:44:35.400

21

Terminal (OSX), 20 18 17 bytes

open http:ppcg.ga

Saved 2 thanks to CoolestVeto

Mwr247

Posted 2016-03-30T14:57:12.053

Reputation: 3 494

5open is an OSX utility, not a bash one; this would be more appropriately called "OSX command line". – Skyler – 2016-03-30T15:17:20.737

1

@Skyler Is this incorrect then? http://ss64.com/bash/open.html

– Mwr247 – 2016-03-30T15:19:32.333

1the first line: "Open a file in its default application, using virtual terminal (VT)." If you try to run that on unix, it will tell you "Couldn't get a file descriptor referring to the console", because it's trying to open in a terminal, not in a browser. – Skyler – 2016-03-30T15:21:33.887

3You can get rid of //. – Addison Crump – 2016-03-30T18:50:06.177

2You can save another byte: open http:ppcg.ga – DarkDust – 2016-04-02T13:52:55.957

14

MATLAB, 28 25 bytes

web www.ppcg.lol -browser
  • www is shorter than http:// and ensures that the address is processed as a URL
  • This is shorter using the implicit function call (which casts inputs as strings) rather than the explicit version web('www.ppcg.lol', '-browser').
  • If you are on a OS X, this can be simplified to web ppcg.lol -browser as MATLAB will automatically append an http:// (21 bytes)

Alternatives:

  • On windows this can be shortened to (19 bytes)

    !start www.ppcg.lol
    
  • On OS X (21 bytes)

    !open http://ppcg.lol
    
  • The following would work in a deployed MATLAB application (16 bytes)

    web www.ppcg.lol
    
  • If the built-in browser could be used this could be reduced even further as http is implied (12 bytes)

    web ppcg.lol
    

Suever

Posted 2016-03-30T14:57:12.053

Reputation: 10 257

OS X is redundant because the built-in open command does the same. – noɥʇʎԀʎzɐɹƆ – 2016-03-30T15:50:50.883

1@CrazyPython That's precisely what ! does in MATLAB, it's the equivalent of system(command). I had it as more of a demonstration of other alternatives that could be executed from within MATLAB. Is that OK? – Suever – 2016-03-30T15:53:40.163

Do you need the www.? – Addison Crump – 2016-03-30T19:02:43.473

@CoolestVeto Sometimes you do sometimes you do not. When using the external browser you do, however the internal browser you do not. If you do not specify it, no browser window will open. If you can get it to work, I'm more than happy to change it! – Suever – 2016-03-30T19:07:31.630

@CoolestVeto So I dug a little more and it looks like the www is unnecessary only on OS X – Suever – 2016-03-30T21:10:05.270

@Suever that should be fine as long as you mark it OS X only. – Rɪᴋᴇʀ – 2016-03-30T21:53:45.767

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:47:54.897

13

Python, 52 48 47 45 44 bytes

Shamelessly borrowing that shortened link.

from webbrowser import*;open("http:ppcg.ga")

Thanks to CrazyPython for -4 bytes, and Sp3000 for a further one.

Edit: shaved 2 more off thanks to CoolestVeto

Edit: thanks to MD XF for registering ppcg.ga and saving another byte

Skyler

Posted 2016-03-30T14:57:12.053

Reputation: 897

The former change leaves it exactly the same length. As for the http://, if you leave that out it tries to open a local file called "ppcg.lol", which doesn't exist. – Skyler – 2016-03-30T15:27:42.197

1You don't need //. – Addison Crump – 2016-03-30T19:06:13.617

Thanks! I wonder why that works? – Skyler – 2016-03-30T19:10:29.723

I've always seen the // as convention, I don't think you need it for some browsers. – Addison Crump – 2016-03-30T19:12:00.460

1You can also do this with just command line options python -m webbrowser -t http:ppcg.lol which I think counts as 30 chars – gnibbler – 2016-03-31T06:24:41.960

1ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:48:10.107

@MDXF thanks, updated the answer. – Skyler – 2017-07-26T14:35:33.197

13

AutoHotKey, 16 bytes

Run www.ppcg.lol

Michelfrancis Bustillos

Posted 2016-03-30T14:57:12.053

Reputation: 695

7Unfortunately, not everybody has shudder Google Chrome shudder set as their default browser (or installed at all!). – wizzwizz4 – 2016-03-30T18:23:02.140

5Not everyone has AHK either...both facts are very shudder worthy – Michelfrancis Bustillos – 2016-03-30T18:23:57.283

5I was shuddering because I had to type... never mind. – wizzwizz4 – 2016-03-30T18:26:47.097

2The challenge spec requires opening PPCG in the default browser, which may or may not be Chrome. – Dennis – 2016-03-30T18:40:58.610

@Dennis fixed...actually saved me some bytes – Michelfrancis Bustillos – 2016-03-30T18:43:42.280

Great! Can't you drop the www.? – Dennis – 2016-03-30T19:00:05.827

Unfortunately not :( – Michelfrancis Bustillos – 2016-03-30T19:01:40.840

Do you need the space between Run, and www.? – Addison Crump – 2016-03-30T19:08:14.893

1You don't need the comma – Engineer Toast – 2016-03-30T19:31:13.260

Its an either/or comma or space. This also makes it the shortest competing entry so far. – Michelfrancis Bustillos – 2016-03-30T21:18:05.857

@wizzwizz4 ಠ__ಠ – Rɪᴋᴇʀ – 2016-03-30T21:52:12.337

@wizzwizz4 What's wrong with Google Chrome? – dkudriavtsev – 2016-07-26T23:59:57.333

@DmitryKudriavtsev What isn't? :-) – wizzwizz4 – 2016-07-27T08:38:56.880

@wizzwizz4 I use it daily, have no problems with it – dkudriavtsev – 2016-07-27T18:04:27.167

@DmitryKudriavtsev Let's not start a browser war. (I always win them, whether that's by having a good case or by still standing there talking 6-8 weeks after everybody else left!) – wizzwizz4 – 2016-07-27T19:49:28.213

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:48:01.637

10

Bash, 24 22 bytes

xdg-open http:ppcg.lol

Not as short as some others. firefox ppcg.lol is shorter, but it doesn't meet question spec.

Ogaday

Posted 2016-03-30T14:57:12.053

Reputation: 471

xdg-open www.ppcg.lol works for me as well. – Digital Trauma – 2016-03-30T17:47:51.957

@digital_trauma interesting, it didn't for me. It looked for www.ppcg.lol on the file system. Ubuntu 15.10. – Ogaday – 2016-03-30T18:29:18.370

Weird. Ubuntu 14.04 for me. xdg-utils 1.0. – Digital Trauma – 2016-03-30T18:37:53.493

1You shouldn't need the //. – Addison Crump – 2016-03-30T19:03:26.133

1@CoolestVeto Correct. xdg-open http:ppcg.lol also works for me. – Digital Trauma – 2016-03-30T20:18:04.523

@CoolestVeto @Digital_Trauma that works for me. Still can't get the www. version to work. xdg-open --version returns xdg-open 1.1.0 rc3 but interestingly when I try to pass www.ppcg.lol I get an error message about gvfs-open. How do I find out which version of xdg-utils I have? – Ogaday – 2016-03-30T21:14:47.300

Why do you need the xdg-? – OldBunny2800 – 2016-04-01T22:12:18.027

@OldBunny2800 I'm using bash on Ubuntu 15.10 - open doesn't work while xdg-open does. See this answer. http://codegolf.stackexchange.com/a/76611/49161 If it is run in the Virtual Terminal on OS X it does work, though I don't have a mac so I can't verify.

– Ogaday – 2016-04-04T09:52:48.970

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:48:31.863

10

Java 7, 118 115 bytes

class P{public static void main(String[]a)throws Exception{java.awt.Desktop.getDesktop().browse(new java.net.URI("http://ppcg.lol"));}}

Java is not the best language for golfing... Here's the same program in a more readable format:

class P {
    public static void main (String[] a) throws Exception {
        java.awt.Desktop.getDesktop().browse(new java.net.URI("http:ppcg.ga"));
    }
}

Saved 2 bytes by removing // in the URI/L, and another byte by switching to .ga from .lol (indirectly thanks to @Milo)

HyperNeutrino

Posted 2016-03-30T14:57:12.053

Reputation: 26 575

8Use interface for shorter code – Mego – 2016-03-30T16:34:13.183

1@Mego I could do that, but then it would be Java 8. This is a Java 7 answer. But thanks for the tip! – HyperNeutrino – 2016-03-30T17:11:24.017

1Replace "http://ppcg.lol" with "http:ppcg.lol" – Addison Crump – 2016-03-30T18:59:55.300

8[tag:code-golf] specifies that functions are sufficient, you do not have to write a full program. So void f(){ .... } would be enough. – flawr – 2016-03-30T19:52:11.920

1Your program in more readable format is missing a closing parenthesis – Nzall – 2016-03-30T22:28:45.190

@NateKerkhofs Whoops! My bad! Thanks for noticing! :) – HyperNeutrino – 2016-03-31T19:30:52.153

Also, it says java.new.URI in the ungolfed version. – RAnders00 – 2016-04-01T11:54:31.033

@RAnders00 Acknowledged. Thanks. – HyperNeutrino – 2016-04-02T01:11:29.743

Can static blocks throw exceptions? If yes, use one. – Mega Man – 2016-09-24T19:01:36.120

9

Java 8, 115 112 bytes

interface P{static void main(String[]a)throws Exception{java.awt.Desktop.getDesktop().browse(new java.net.URI("http:ppcg.ga"));}}

Java is not the best language for golfing... Here's the same program in a more readable format:

interface P {
    static void main (String[] a) throws Exception {
        java.awt.Desktop.getDesktop().browse(new java.net.URI("http:ppcg.ga"));
    }
}

Saved 2 bytes by removing // (thanks @CoolestVeto), and another byte by switching to .ga from .lol (indirect thanks to @Milo)

HyperNeutrino

Posted 2016-03-30T14:57:12.053

Reputation: 26 575

You can remove the //. – Addison Crump – 2016-03-30T19:04:45.197

Isn't it supposed to be java.net? – Ryan – 2016-03-31T14:04:57.293

cant you replace interface with class? – MCMastery – 2016-03-31T15:24:15.853

@MCMastery Yes. However, with an interface, you can save 3 bytes because even though interface is longer than class, you save more bytes because the public modifier is implied. – HyperNeutrino – 2016-03-31T19:32:09.170

@Ryan Whoops. Fail. Yes, you're right. Thanks! – HyperNeutrino – 2016-03-31T19:34:17.397

9

Pylongolf, 11 bytes (Non-Competing)

"ppcg.lol"p

Pushes ppcg.lol into the stack then p opens it.

user47018

Posted 2016-03-30T14:57:12.053

Reputation:

Will that open it as a local file, or as a website address? – wizzwizz4 – 2016-03-30T18:09:06.557

And did you just add the changes that allowed this to work? – Rɪᴋᴇʀ – 2016-03-30T18:09:29.400

@wizzwizz4 As an address.
Yes, so this does not compete with others, just for fun.
– None – 2016-03-30T18:23:05.060

6If I were you, I would edit "(Non-competing)" into the title, so people don't downvote. – wizzwizz4 – 2016-03-30T18:24:35.023

@wizzwizz4 done. – Rɪᴋᴇʀ – 2016-03-31T19:57:54.373

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:48:44.227

Lemme guess, freenom? – None – 2017-07-26T11:32:23.873

8

JavaScript, 34 bytes

require('open')('http://ppcg.lol')

Uses Node.js

Downgoat

Posted 2016-03-30T14:57:12.053

Reputation: 27 116

Do you need //? – Addison Crump – 2016-03-30T19:04:35.903

2If node.js supports ES6: require`open``http://ppcg.lol`; (added ; to avoid tripping the formatting) – Ismael Miguel – 2016-03-31T08:17:20.033

2Alternatively, does it require a protocol? eg require('open')('//ppcg.lol') to save 5 bytes – Martijn – 2016-03-31T11:56:03.423

2@Martijn Shh... – wizzwizz4 – 2016-03-31T15:36:37.837

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:48:55.013

7

Racket, 41 40 bytes

(require net/sendurl)(send-url"ppcg.ga")

Winny

Posted 2016-03-30T14:57:12.053

Reputation: 1 120

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:03.313

Thanks for commenting. I'll update my answer in front of a computer later today. :) – Winny – 2017-07-26T19:00:39.797

6

Mathematica, 28 bytes

SystemOpen@"http://ppcg.lol"

Martin Ender

Posted 2016-03-30T14:57:12.053

Reputation: 184 808

That would be 16 bytes in Mthmtca. – Michael Stern – 2016-03-30T18:40:09.947

Do you need //? – Addison Crump – 2016-03-30T19:04:13.463

@CoolestVeto I think I do. – Martin Ender – 2016-03-30T19:05:10.983

1@MichaelStern Is that a thing? I want. – Mario Carneiro – 2016-03-31T12:49:18.577

@MarioCarneiro A development version can be found at https://github.com/LegionMammal978/Mthmtca I don't have the system to make it work, but I'm counting on future releases being platform-agnostic.

– Michael Stern – 2016-03-31T12:52:33.210

@MichaelStern How does that actually work if the host doesn't have Mathematica installed? Isn't it licensed or something lame? – cat – 2016-04-11T00:21:52.003

@cat to do anything useful you're going to need a Mathematica license. The good news is that it's bundled with the Raspberry Pi OS, which means your entry point could be a low as $5 (with a Pi Zero), though $35 (with a Pi 3b) may be more practical. – Michael Stern – 2016-04-11T00:26:00.920

@MichaelStern Oh, so still closed-source and equally lame, then. Ah well, at least it won't be eligible for [tag:cops-and-robbers]... – cat – 2016-04-11T00:28:44.593

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:25.843

6

Applescript, 28 bytes

  • 3 bytes saved thanks to @CoolestVeto.
open location"http:ppcg.lol"

Digital Trauma

Posted 2016-03-30T14:57:12.053

Reputation: 64 644

1how dare a high-rep user not format their header correctly D: – cat – 2016-04-11T00:08:05.213

1@cat actually, I've never been called out on this before - I've always operated on the assumption that bytes is the default for codegolf (and is even explicitly specified in this question), so explicitly respecifying in answers is just redundant information. Do you know of a meta post about this? – Digital Trauma – 2016-04-14T05:32:21.763

Well, first and foremost, my comment was messing around -- I only changed it for consistency with all the other answers, and it's really insignificant but it bothered me. I'm pretty sure there's no meta post on formatting specifically, and that this format came from the Leaderboard Stack Snippets, but I'm almost certain there's a meta post for Defaults for Scoring Code Golf that says it's bytes unless otherwise specified. – cat – 2016-04-14T10:15:35.193

1

@cat Yep, I don't think its a big deal either way - I'm certainly not planning on rolling back your edit :). Scoring by bytes by default is in the code-golf tag wiki

– Digital Trauma – 2016-04-14T10:32:23.950

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:14.397

5

R, 26 bytes

shell.exec("www.ppcg.lol")

I don't know of any shorter way to do this in R.

syntonicC

Posted 2016-03-30T14:57:12.053

Reputation: 329

1

Duplicate of this. Simply wrapping another answer in a system/fork/whatever call is a trivial modification.

– Mego – 2016-03-30T19:40:22.050

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:33.340

5

Actionscript 3, 117 bytes

package{import flash.display.Sprite;public class A extends Sprite{function A(){navigateToUrl("ppcg.lol","_blank")}}}

Like Java, this is not a great golfing language. Here's the code with formatting:

package
{
    import flash.display.Sprite;

    public class A extends Sprite
    {
        function A()
        {
            navigateToUrl("ppcg.lol", "_blank")
        }
    }
}

Brian

Posted 2016-03-30T14:57:12.053

Reputation: 231

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:44.830

5

Perl 5, 66 57 bytes

Should work everywhere, but needs that import :(

8 bytes saved with @msh210 comment.

use Browser::Open open_browser;open_browser"http:ppcg.ga"

Also, for funsies :

Perl 5 (Windows), 34 bytes

system "start http://www.ppcg.ga"

Perl 5 (Unix), 31 bytes

system "xdg-open http:ppcg.ga"

Paul Picard

Posted 2016-03-30T14:57:12.053

Reputation: 863

use -M instead of use to shave a coupla bytes. (Untested.) Also, I'm guessing you don't need the parens or the www.. (Also untested.) – msh210 – 2016-04-01T21:40:09.637

@msh210 Can't seem to get the -M switch to work apparently on my Mac... (?), but indeed the www as well as the // can be removed. Thanks ! – Paul Picard – 2016-04-03T08:46:53.837

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:49:56.723

Edit done. Thank you for keeping old answers up to date :) – Paul Picard – 2017-08-23T14:02:06.563

5

Rebol 2, 16 15 bytes

browse"ppcg.ga" 

if you accept an error before opening the page on Linux, no error on Windows

20 bytes without an error

browse http:ppcg.lol

sqlab

Posted 2016-03-30T14:57:12.053

Reputation: 181

Alternative to the first one (although with the same score): browse #ppcg.lol – Izkata – 2016-04-01T20:02:57.023

now with shorter url.( – sqlab – 2016-04-13T11:53:23.963

3

VBScript, 57 bytes

I used to have lots of fun creating tiny programs in VBScript, back in 2010.

I've remembered this language and used the code on: https://stackoverflow.com/a/13401872/2729937

It still works on Windows 7, at least.

set S=CreateObject("WScript.Shell")
S.run("www.ppcg.ga")

This is a bit different from the usual start www.ppcg.lol, in the sense that it executes the www.ppcg.ga directly, with an implicit start.

An alternative way would be "cmd.exe /C start www.ppcg.ga".

Ismael Miguel

Posted 2016-03-30T14:57:12.053

Reputation: 6 797

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:50:07.403

@MDXF Thank you for that tip. While it is nice to save a byte, I won't change the score since it doesn't feel fair. – Ismael Miguel – 2017-07-26T13:45:12.247

3

RFO-BASIC, 22 bytes

BROWSE "http:ppcg.lol"

Read about RFO-BASIC at laughton.com.

TickTock

Posted 2016-03-30T14:57:12.053

Reputation: 101

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review

– Mego – 2016-04-01T16:06:13.300

Alright. I just figured most people wouldn't know about this "dialect" of BASIC. – TickTock – 2016-04-01T16:07:50.510

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. Also, couldn't the space between BROWSE and " be removed, saving another byte? – MD XF – 2017-07-26T03:50:31.140

3

Common Lisp, 31 bytes

(ext:shell "open http:ppcg.ga")

JPeroutek

Posted 2016-03-30T14:57:12.053

Reputation: 734

2

Factor, 38 36 26 bytes

[ "http:ppcg.ga" open-url ]

I didn't know one could golf-off the // in the protocol.

cat

Posted 2016-03-30T14:57:12.053

Reputation: 4 989

I think you can remove the space between the end-quote and run-process, and you can wholly drop //. – Addison Crump – 2016-03-30T19:16:44.100

@CoolestVeto Thanks! I didn't know the // could be left off. As for the space between " and run-process, dropping that would require a word named "run-process to be present in the current vocabulary search path – cat – 2016-03-30T19:22:48.270

@CoolestVeto Factor's like Forth -- highly whitespace dependent – cat – 2016-03-30T19:24:01.963

Duplicate of this. Simply wrapping another answer in a system/fork/whatever call is a trivial modification.

– Mego – 2016-03-30T19:35:40.187

@Mego Okay, well, not that it really matters but I did come up with this without seeing that one. But, there is really no other way to run The default browser without xdg-open in languages which are not equipped with special functions for browsing the web. A C or ASM answer would surely also have to do system("xdg-open...") – cat – 2016-03-30T19:44:01.010

@Mego A C or ASM answer on Windows would also just be wrapping the Batch answer: system("start...") – cat – 2016-03-30T19:46:06.047

@cat Correct. Such an answer would also be a duplicate. – Mego – 2016-03-30T19:49:04.980

@Mego But it's not the same language so how can it be a duplicate? If I just reimplement someone else's sorting algorithm in my very different, much more / less verbose language, is that also a duplicate? – cat – 2016-03-30T19:55:27.430

@cat There is a significant difference between re-implementing an algorithm in a different language and wrapping another submission in a system/fork/exec call. – Mego – 2016-03-30T19:58:47.760

Marking this answer as non-competing does not exempt it from being invalid as per this policy

– Mego – 2016-03-30T20:17:05.493

@Mego I didn't know Factor actually had a builtin for this – cat – 2016-04-03T13:11:12.727

2

05AB1E, 16 bytes (non-competing)

Non-competing, since the features used here postdate the challenge. Code:

’…Ò ™³.ÐÏg.´¢’.E

You can try the string online here. This basically evaluates to this batch answer.

Uses the CP1252 encoding.

Adnan

Posted 2016-03-30T14:57:12.053

Reputation: 41 965

How do you count the bytes? Depending which program I use for counting I get from 21 to 34 bytes. – sqlab – 2016-03-31T08:57:47.380

@sqlab 05AB1E uses the CP1252 encoding. – Adnan – 2016-03-31T09:01:27.553

2

Ruby, 22 20 19 bytes (on OS X)

`open http:ppcg.ga`

Simple.

Thanks to Daniel for 2 bytes off.

Rɪᴋᴇʀ

Posted 2016-03-30T14:57:12.053

Reputation: 7 410

You can save 2 characters by using backticks instead of %x. open http:ppcg.lol – Daniel Evans – 2016-03-31T07:31:17.117

@DanielEvans Great, thanks. That saves 2 bytes. – Rɪᴋᴇʀ – 2016-03-31T15:18:51.750

1"'open' is not recognized as an internal or external command, operable program or batch file." – Dewi Morgan – 2016-04-01T18:07:22.903

1@DewiMorgan OS X only. – Rɪᴋᴇʀ – 2016-04-01T22:35:50.890

2

C#, 33 bytes

Process.Start("http://ppcg.lol");

Opens the default browser to the web address

Travis J

Posted 2016-03-30T14:57:12.053

Reputation: 141

Nope... Replace \\ via //. – Qwertiy – 2016-03-31T01:16:33.333

not a c# program, just a single line – BryanJ – 2016-04-01T13:31:04.690

Also this needs the System.Diagnostics namespace to be added in or Process to be fully qualified to work. – TheLethalCoder – 2016-04-01T15:25:35.067

1This is not a c# program. – Vahid Amiri – 2016-04-03T14:36:13.273

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:50:42.247

2

VB.NET, 32 30 bytes

Process.Start("http:ppcg.lol")

Matt Wilko

Posted 2016-03-30T14:57:12.053

Reputation: 121

+10 for Sub Main(), and +7 for End Sub, which you need in order to run this at least in a VB.NET console program, also you would need to import System.Diagnostics. – Virtual Anomaly – 2016-04-12T12:26:11.783

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:50:57.247

2

Python, 44 bytes

from webbrowser import*;open('http:ppcg.ga')

URL from this comment
Edit: ppcg.ga seems to become more popular now (but it WAS available when I posted this answer).

Ungolfed:

from webbrowser import * # Loads everything in the webbrowser module
open("http://ppcg.ga/") # Opens default browser to http://ppcg.ga/

Python, 44 bytes

from webbrowser import*;open('http:gfa1.tk')

URL from this answer

Ungolfed:

from webbrowser import * # Loads everything in the webbrowser module
open("http://gfa1.tk/") # Opens default browser to http://gfa1.tk/

Python, 45 bytes

from webbrowser import*;open('http:ppcg.lol')

Ungolfed:

from webbrowser import * # Loads everything in the webbrowser module
open('http://ppcg.lol/') # Opens default browser to http://ppcg.lol/

Take that, ppcg.lol! (1 byte shorter)

Note: I added a separate answer leading to ppcg.lol, 'cause I've noticed the other sites doesn't work for me in Internet explorer 11, and I saw other users having this problem too.

Both are non-non-competing (read that right?)

Erik the Outgolfer

Posted 2016-03-30T14:57:12.053

Reputation: 38 134

2

Cheddar, 65 bytes

cheddar.internal(cheddar.uid).require("open").c("http://ppcg.ga")

Accesses cheddar internals and then calls upon open package and calls it with string to PPCG. Make sure you have open npm package installed

Downgoat

Posted 2016-03-30T14:57:12.053

Reputation: 27 116

Shouldn't this be Cheddar+Open if it requires another package? – Pavel – 2017-02-25T03:54:46.170

1

NodeJS, 53 bytes

require('child_process').exec('open http://ppcg.lol')

Works on mac.

Mwr247

Posted 2016-03-30T14:57:12.053

Reputation: 3 494

2

Duplicate of this

– Mego – 2016-03-30T18:58:48.267

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:51:19.660

1

Python, 43 41 40 bytes

import os
os.system("open http:ppcg.ga")
  • -2 bytes thanks to @Quill.
  • -1 byte thanks to @MDXF.

Zach Gates

Posted 2016-03-30T14:57:12.053

Reputation: 6 152

Duplicate of this

– Mego – 2016-03-30T18:57:55.820

4@mego how is it a duplicate - It's not even the same language! – proud haskeller – 2016-03-30T22:30:43.513

@proudhaskeller See my comments on this answer

– Mego – 2016-03-30T23:56:33.863

@mego on the nominations for moderator you said yo believe in hands-off moderation. I don't see how this is reflected here. – proud haskeller – 2016-03-31T06:03:41.817

@proudhaskeller By hands-off moderation, I mean letting the community do all the moderation work that it can, rather than stepping in with mod powers. As I am neither a moderator nor using moderation powers/privileges, this is still hands-off moderation. If you wish to discuss my views on moderation further, I would encourage you to do so with me in the chatroom created specifically for that purpose.

– Mego – 2016-03-31T06:10:20.877

@Mego I opened a discussion in meta about this issue – proud haskeller – 2016-03-31T06:32:19.893

@ZachGates, you can remove turn http:// into http: and it should have the same effect – Quill – 2016-03-31T09:29:58.290

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:51:28.550

1

Dyalog APL, 20 19 bytes

-1 byte thanks to MD XF

]Open http://ppcg.ga

Uses the User Command ]Open, which is installed with Dyalog.

Adám

Posted 2016-03-30T14:57:12.053

Reputation: 37 779

Needs you the //? – Addison Crump – 2016-03-30T19:31:05.653

1@CoolestVeto Yes, otherwise you get an error: * Command Execution Failed: File not found – Adám – 2016-03-30T19:34:33.907

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:52:32.103

@PatrickRoberts Thanks. Half an edit. I must have become distracted in the middle. – Adám – 2017-07-27T21:12:39.247

1

PHP (OSX), 33 bytes

<?php exec("open http:ppcg.lol");

PHP (Windows), 34 bytes

<?php exec("start http:ppcg.lol");

Quill

Posted 2016-03-30T14:57:12.053

Reputation: 576

"'open' is not recognized as an internal or external command, operable program or batch file." – Dewi Morgan – 2016-04-01T18:06:35.683

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:51:38.543

1

Game Maker Studio, 26 bytes

url_open('http://ppcg.ga')

Timtech

Posted 2016-03-30T14:57:12.053

Reputation: 12 038

This is not a complete program. Anyway, have +1 for using GameMaker Studio xDDDDDD – Luis Masuelli – 2016-04-08T21:18:01.190

@LuisMasuelli Yes it is. No need to use a script or anything - there is a way to run "creation code" in the room settings, which is usually how you would run any GML code for this site. But thanks ;) – Timtech – 2016-04-08T22:58:28.727

U're right. There's actually no way of posting a complete program since most of the execution is not done by explicit code but GMS internal lifecycle. – Luis Masuelli – 2016-04-08T23:00:33.650

@LuisMasuelli Yes, that's why I usually only use the GML code script in the objects and room creation code, none of the drag-and-drop anymore. – Timtech – 2016-04-08T23:02:24.230

1

Windows Batch, 17 bytes

start www.gfa1.tk

Isaiah

Posted 2016-03-30T14:57:12.053

Reputation: 31

You should include the language for this. Also, this is a trivial improvement upon an existing answer, and thus it should have been a comment rather than a separate answer. – Mego – 2016-04-02T02:14:50.940

ppgc.ga is working now. – Tim – 2016-04-02T20:35:27.740

gfa1.tk has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:52:17.500

1

C# (Full Class) 89 bytes

class P{static void Main(string[]a){System.Diagnostics.Process.Start("http://ppcg.ga");}}

Not sure that it's possible to write a full class (with the System.Diagnostics reference) any shorter.

Inside main method only without references, 32 bytes:

Process.Start("http://ppcg.ga");

SkyPharaoh

Posted 2016-03-30T14:57:12.053

Reputation: 109

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:51:50.460

1

Perl 6, 45 bytes

Requires the Browser::Open module.

use Browser::Open;open_browser 'http:ppcg.ga'

Ming-Tang

Posted 2016-03-30T14:57:12.053

Reputation: 5 383

Do you really need that one whitespace? I can't test this right now. – cat – 2016-04-29T12:26:20.890

Yes, Perl 6 has strict whitespace requirements. – Ming-Tang – 2016-04-30T03:34:07.807

1

C++, 61 Bytes

#include <cstdlib>
main(){system("xdg-open http:ppcg.lol");}

Just a rip off of the bash solution using system, and it only works on systems using the freedesktop tools. Also shortened by using the short link some kindly provided, otherwise it would be much longer.

HSchmale

Posted 2016-03-30T14:57:12.053

Reputation: 181

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:51:59.103

1

Lua, 30 Bytes

os.execute'start http:ppcg.ga'

Katenkyo

Posted 2016-03-30T14:57:12.053

Reputation: 2 857

0

Python, 40 bytes

__import__('webbrowser').open('ppcg.ga')

Shorter version of everything else.

NoOneIsHere

Posted 2016-03-30T14:57:12.053

Reputation: 1 916

0

VBScript, 47 bytes

CreateObject("WScript.Shell").Run"http:ppcg.gq"

Lewis

Posted 2016-03-30T14:57:12.053

Reputation: 121

0

C (gcc), 49 38 37 bytes

main(){system("start http:ppcg.ga");}

It's for Windows.

girobuz

Posted 2016-03-30T14:57:12.053

Reputation: 391

0

URL, 58 bytes

[InternetShortcut]
URL=https://codegolf.stackexchange.com

In Windows create a file "url.URL", with a code editor put the code.

erianvc

Posted 2016-03-30T14:57:12.053

Reputation: 1

1

Welcome to the site! As it isn't clear whether this works or not, could you provide either instructions for running this, or a link to an online testing environment such as TryItOnline!, so that others can verify your answer?

– caird coinheringaahing – 2019-09-21T19:01:40.920

0

R, 28 bytes

browseURL("http://ppcg.lol")

(in utils package)

mnel

Posted 2016-03-30T14:57:12.053

Reputation: 826

1ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:52:25.557

0

SX, 38 bytes (might be non-competing)

的 webbrowser im**;o&('http:ppcg.ga')

Save this shell script as SXexec.sh to your SX directory:

#!/bin/sh
N=$1.py;python Main.py $1;wine SXCompiler.exe $N;rm $N;python $N.py;rm $N.py

The script features tidying up after execution. To execute the above script, you need to have Wine and Python. Usage is like this:

SXexec.sh file

Erik the Outgolfer

Posted 2016-03-30T14:57:12.053

Reputation: 38 134

0

Nim, 47 bytes

import browsers
openDefaultBrowser"www.ppcg.ga"

Copper

Posted 2016-03-30T14:57:12.053

Reputation: 3 684

ppcg.lol has been unregistered, invalidating this answer :I However, I just registered ppcg.ga, so you can use that instead, saving a byte anyway. – MD XF – 2017-07-26T03:52:52.313

ppcg.ml also works – Skidsdev – 2017-07-26T08:07:22.340