Skip to content

Instantly share code, notes, and snippets.

@jimmyjacobson
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyjacobson/ca5f987184fdf87c0198 to your computer and use it in GitHub Desktop.
Save jimmyjacobson/ca5f987184fdf87c0198 to your computer and use it in GitHub Desktop.
Embedding a Wedgie Poll on your Website

Embedding a Wedgie Poll on your Website

Wedgies is a platform for real time polls across social channels. You can create a question on Wedgies.com and share it to Facebook or Twitter immediately. You can also use our widget to embed the question on your website or blog and gather responses while creating engagement. We have provided javascript, iframe and WordPress plugin solutions to help you get started.

Javascript

Example on CodePen

<script src='https://www.wedgies.com/js/widgets.js'></script>
<div class='wedgie-widget' wd-owner="true" wd-social="true" wd-branding="true" wd-pending wd-type='embed' wd-version='v1' id='52effb88d91c6202000009cd' style='max-width: 720px; '></div>

The javascript code to generate the Wedgies widget can be obtained from Wedgies.com after creating a question or by using the

By including the javascript library you also get access to a callback function that can be used to re-render the embedded polls based on any event in the browser. This method takes an optional callback.

Wedgies.render()

OEmbed endpoint:

The OEmbed call contains a thumbnail of the Question that can be used as a cover image.

Example: https://www.wedgies.com/services/oembed?url=https%3A%2F%2Fwww.wedgies.com%2Fquestion%2F52effb88d91c6202000009cd

Parameters:

  • url: encoded url of the Question to embed in the format https://www.wedgies.com/question/*
  • maxheight: maximum height of the embed. This widget is responsive and will respond to the height of the container it is placed in on any website.
  • maxwidth: maximum width of the embed. This widget is responsive and will respond to the height of the container it is placed in on any website.
  • format: xml or json are supported
  • social: when false, twitter and facebook share buttons are removed. Defaults to true.
  • owner: when false, Question asker picture and name are omitted from embedded poll. Defaults to true.
  • branding: when false, Wedgies branding is removed from embedded poll. Not available to all users. Defaults to true.
  • redirectUrl: URL where shared traffic is to be directed. Use this to send traffic to your blog page with a embedded poll in it. Must be encoded.
  • iframe: when true, returns iframe code instead of javascript for embedding. Default is false.

Attributes to the DIV with class wedgies-widget

  • wd-social
    • true - shows the tweet/facebook buttons inside the footer of the widget
    • false - hides the tweet/facebook buttons inside the footer of the widget
  • wd-owner
    • true - shows the creator of the question inside the header of the widget
    • false - hides the creator of the question inside the header of the widget
  • wd-branding
    • true - hides the Wedgies logo inside the footer of the widget
    • false - hides the Wedgies logo inside the footer of the widget
  • data-wd-opt-redirectUrl - takes a non encoded URL. When a visitor interacts with the social share buttons on the widget, this URL is shared out instead of the default Wedgies question URL. This feature is only available to paid customers of Wedgies.com (https://www.wedgies.com/pricing) and select channel partners.
  • data-wd-development - loads questions from localhost
  • data-wd-staging - loads questions from the staging environment

Embedly

Wedgies Polls can be embedded directly into platforms that use the Embedly API by copying and pasting the URL to a poll into a post.

IFrame

<iframe scrolling="no" title="Vote on this poll" src="https://www.wedgies.com/widgets/embed/question/52effb88d91c6202000009cd?widgetVersion=v1&amp;redirectUrl=http%3A%2F%2Fs.codepen.io%2Fboomerang%2F7ed36833bed25f9aa3bb4970b7d5a5141391460152885%2Findex.html&amp;social=true&amp;owner=true&amp;colophon=true" width="100%" style="width: 100%; height: 500px; border: 0px;"></iframe>

Example on CodePen

If you don't want to use our script code, you can embed a Widget directly with an iframe using the following code

https://www.wedgies.com/widgets/embed/question/*

The following parameters are accepted in the query string

  • social
    • true - shows the tweet/facebook buttons inside the footer of the widget
    • false - hides the tweet/facebook buttons inside the footer of the widget
  • owner
    • true - shows the creator of the question inside the header of the widget
    • false - hides the creator of the question inside the header of the widget
  • branding
    • true - hides the Wedgies logo inside the footer of the widget
    • false - hides the Wedgies logo inside the footer of the widget
  • redirectUrl - takes an encoded URL. When a visitor interacts with the social share buttons on the widget, this URL is shared out instead of the default Wedgies question URL. This feature is only available to paid customers of Wedgies.com (https://www.wedgies.com/pricing) and select channel partners.

Word Press Plugin

Available here: http://wordpress.org/plugins/wedgies-shortcode/

Questions?

Shoot us an email to info@wedgies.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment