I recently recently launched a new WordPress plugin for Google's Universal Analytics. Check it out!.
Close

Creating a share button for App.net

Creating a share button for App.net

So you’ve probably got a Facebook, Twitter and Google+ share button on your site, but what about App.net? This post will walk you through the steps to add an App.net share button to your website. Though we’ll focus on the setup for WordPress, we will cover the basics which will allow you to add it to any site.

What is App.net?

Incase you’re not sure what App.net (ADN) is, its a fast growing subscription-based, advertising-free social network. They also recently introduced a “freemium” model so if you’re interested in checking it out, let me know.

Why do I need an ADN share button?

Well I guess in all honesty you don’t “need” an app.net share button, but isn’t it kinda awesome that you can have one? Let me take a second and tell you how this all came about…

ADN is still a young social network and out of the gate it doesn’t have all the bells and whistles that some of the other networks like Facebook and Twitter do. One of these missing items was a way to easily share from a website so in October of 2012 I reached out to Dalton Caldwell, the founder of ADN and asked how we could make this happen. After a quick discussion there was a ticket made in App.net’s api-spec on github. Since ADN is heavily supported by it’s developer community it wasn’t long before there was a solution. So cheers to everyone that made this happen.

How it works

ADN is using the post intent of Web Intents (just like Twitter). What this means is it allows you to create a link that will present the user with a post creation box and any pre-filled text that you may have supplied. Take the URL below for example. It will create a post that reads “@unscripted is my hero.”

https://alpha.app.net/intent/post?text=@unscripted+is+my+hero

There are two parts to this URL. The first is the URL to the intent.

https://alpha.app.net/intent/post

Second is your message. Using the text query parameter we can add any message we like.

?text=Your+message+here

Pretty simple right?

ADN share button for WordPress

You can use the method above pretty much anywhere, but what if you want your message to contain the title and url of your WordPress post. It’s really just as simple as above. To get the title we’ll use the get_the_title function and the get_permalink for the post URL.

https://alpha.app.net/intent/post?text=<?php echo  get_the_title(); ?> <?php echo get_permalink(); ?>

Place this in an href, add a little css and you’ll have your own nifty little share button for ADN.

Here’s a sample of the code I’m using for the share button on this page.

<a class="appnet" title="Share this on App.net" href="https://alpha.app.net/intent/post?text=<?php echo  get_the_title(); ?> <?php echo get_permalink(); ?>" target="_blank">App.net</a>

Conclusion

ADN is constantly getting new features and with it’s support for developers it will continue to grow. This method for creating a share button is only one of many new additions. You can learn more about the Web Intents from App.net’s API Documentation.

Let me know if you have any questions about how to implement an App.net share button into your website.

One Response

  1. aislinn

    thank you for providing this information, i appreciate you spending some time for this article.

    http://www.n8fan.net

Leave a Reply to aislinn

What's on your mind? Fill out the form below to let us know.