Powargrid
  • Home
  • Blog
  • Buy
  • Demo
  • Media
  • Press
  • The Daily Blobbie
  • Blobbie Meme Maker
  • Forums

Linking to Greenlight

7/5/2014

1 Comment

 
Willem came across an interesting article about Greenlight over at Gamasutra, which contained a useful tip I wanted to share with you.
By linking to a URL using the steam:// protocol and an undocumented feature of the Steam client, you can link directly to a game's Greenlight page, inside Steam. The user is generally already logged in to Steam, making it much easier for them to vote.
The URL in question is steam://url/CommunityFilePage/95359349, with the number replaced by your account identifier. The article sends the browser to this URL using server side scripting, but some Javascript works equally well if you prefer a client side solution. Here's what I set up at www.powargrid.com/greenlight - have a peek at the source if you want!
First, an invisible iframe to do the loading in. In several browsers, this prevents an error message if Steam is not installed.
  <iframe id="loader" style="display:none"
height="0" width="0"></iframe>
Then some Javascript to "load" the Steam URL.
 var loader = document.getElementById("loader");
loader.src = "steam://url/CommunityFilePage/95359349";
That's it! I tried to get fancy and make it load the normal Greenlight page if the user doesn't have Steam installed, but making that work across different browsers turned out to be a pain in the neck. Instead, I just included a regular link people will have to click themselves.
That's all, maybe it'll be of use to someone!

Hack on,
Michiel
1 Comment
Michiel link
7/5/2014 07:33:29

Wow, formatting code on this thing is WAY too hard. Ended up using http://hilite.me and manual line breaks to make it look decent.

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    We're Michiel and Willem. Hi!
    This blog is about the development of Powargrid and our experiences in doing so.

    Archives

    June 2017
    May 2017
    November 2016
    October 2016
    September 2016
    July 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    March 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    September 2012
    August 2012

    Categories

    All
    Game Design
    Marketing
    Progress
    Slacking
    Tech

    RSS Feed

© Wee Free Studio | Steam | Twitter | Facebook | RSS feed | Press | Contact