Release ShareSocial - Social media sharing & More
#10
(2012-03-20, 05:49)Bstrdsmkr Wrote: Looking pretty awesome. I'm having a little trouble deciphering the intent behind some of the functions though. Let's say I have one of my list items that points to http://www.example.com/video.avi.

What would I need to feed to RunScript() in order to let a user share that link on Twitter?
Code:
import ShareSocial

share = ShareSocial.getShare('add.on.id','video')

share.media = 'http://site.com/vid.avi'
share.thumbnail = 'http://site.com/vid_thumb.jpg'
share.title = 'appropriate title'
share.page = 'link to page media is hosted on'

share.share()

And that's basically it. Look at the code for the share object to see what other fields there are. You should fill as many as you can so that the target has options on how to display the share.

I just realized you're probably talking about a plugin scenario. In that case you have a couple of options.

You can do as above ( minus the share.share() ) and then call:
Code:
data = share.toString()

call Runscript back to your addon with the string and from there call:

Code:
share = ShareSocial.Share().fromString(data)
share.share()

Alternatively, you can can handle passing whatever data you need back to your script and then build the share at that time. The advantage of that method is that you don't need to import ShareSocial until the user is doing the sharing, outside the plugin operation, which avoids any extra delay the import causes.

All this has given me the idea that perhaps it would be nice to add share.getPluginRunScript() which would return a string you could just drop into the listitem, and which would call ShareSocial which would handle it from there.

I still need to create some documentation of course, but hopefully this is helpful Smile

My goal with this is to make it as simple as possible for an addon author to add sharing - with ShareSocial doing all the work.

Let me know if you have any more questions.

Reply


Messages In This Thread
Re: [RELEASE] ShareSocial - Social media sharing & More - by ruuk - 2012-03-20, 15:40
How to create a feed source - by ruuk - 2012-03-22, 00:41
v0.1.3 - by ruuk - 2012-03-26, 01:23
v0.1.4 - by ruuk - 2012-03-28, 21:25
v0.1.5 - by ruuk - 2012-03-30, 23:48
v0.1.6 - by ruuk - 2012-06-12, 02:47
v0.1.7 - by ruuk - 2012-06-14, 21:08
v0.1.8 - by ruuk - 2012-06-14, 21:48
v0.1.9 - by ruuk - 2012-06-17, 21:24
RE: v0.1.9 - by hasselhof - 2012-06-19, 20:41
RE: v0.1.9 - by ruuk - 2012-06-19, 22:00
v0.2.0 - by ruuk - 2013-01-23, 00:12
v0.2.1 - by ruuk - 2013-10-19, 22:45
v0.2.2 - by ruuk - 2013-10-22, 23:30
v0.2.3 - by ruuk - 2013-10-25, 04:30
v0.2.4 - by ruuk - 2013-10-25, 19:01
v0.2.5 - by ruuk - 2013-10-25, 21:34
v0.2.6 - by ruuk - 2013-10-26, 22:11
v0.2.8 - by ruuk - 2014-04-14, 21:46
Logout Mark Read Team Forum Stats Members Help
ShareSocial - Social media sharing & More1