tmort / Socialite

Other
1.68k stars 163 forks source link

Add Buffer App Button #10

Closed jasondavis closed 12 years ago

jasondavis commented 12 years ago

A lot of you are familiar with Buffer App http://bufferapp.com if you aren't I explain it briefly.

Buffer let's you link your Facebook, Twitter, and LinkedIn accounts to the Buffer app, you then simply click a button to add a post to your buffer and then Buffer will post your post to your networks through out the day (you get to schedule a time frame). The great thing is not only can you add a bunch of things you want to post about to your Buffer which is basically a Que but when you click the button to Buffer an item, you can simply clikc a button to pick which of your networks you want to post it on, all 3 or simply 1 or 2 of them. In the future they will be adding more networks like Google Plus once they release there API.

So anyways I am trying to add the Buffer button located here http://bufferapp.com/extras/button with the extend() function but I am un-successful as I don't really know a whole lot about Javascript and it appears every network currently on Socialite is slightly different in the way it uses the extend() function.

Here is the code to do a Buffer button, it seems to be very similar to the Twitter button. `<a href="http://bufferapp.com/add" class="buffer-add-button" data-text="My body or subject text here" data-url="http://www.test.com" data-count="vertical" data-via="MyTwitterName">Buffer

` If anyone could help add this or show me how to get it working I would be really grateful
dbushell commented 12 years ago

Thanks for the info Jason, I'll look into it!

jasondavis commented 12 years ago

thanks, I really want to add this, I tried but I don't know enough javascript to get it working

outbound commented 12 years ago

Any progress on this - would love to see Buffer integrated with my awesome Socialite app.

dbushell commented 12 years ago

Hi Jason, I've been a bit slow on adding additional widgets because I don't want to pack the main socialite.js file with too many "niche" extensions. I'm looking to make a web form that will allow you to build socialite.js to include only the widgets required. I just need to find the time!

dbushell commented 12 years ago

The Socialite core provides .network() and .widget() functions that are used to add every widget. What I'll probably do for now is add a /extensions folder in the repository; you'll be able to copy & paste the extra code to the end of socialite.js. Check back next week, I'll get Buffer in there :)

jasondavis commented 12 years ago

you are awesome, thank you

dbushell commented 12 years ago

Alrighty! There is a Buffer App extension in the repo.

A Socialite build script isn't ready yet but just minify the extension and paste it at the end of your socialite.js :) (You could save a few bytes by copying the content inside the anonymous function.)

I've done a fair amount of testing and it seems solid. Buffer don't provide any documented JavaScript API for the button and their own activation script is rather primitive, so to activate new instances after the initial load requires a script re-append. Not ideal but I don't want to fake the iframe creation because it isn't publicly documented and therefore could change in future.