Peer5 / ShareFest

Web based p2p file sharing built on WebRTC Data Channels API
1.68k stars 269 forks source link

Replace AddThis with SocialSharePrivacy (hopefully fixes #36) #57

Open thedod opened 11 years ago

thedod commented 11 years ago

Also disabled crazyegg unless it runs from sharefest.me (similar to what is done with google analytics)

shacharz commented 11 years ago

Is it possible to automatically .click() after the share button is activated (the user will need to click only once) but still if he doesn't click it won't load the buttons?

thedod commented 11 years ago

These buttons are iframes AFAIK, so browser security policy (which sometimes coincides with reasonable security considerations) wouldn't let us do this, or you could make your users auto-like your page :)

Anyway - Heise (with a huge readership in the land of CCC) tried their best and came up with this. I guess 1 click is either impossible or a vulnerability.

thedod commented 11 years ago

Note: even if you reject this pull request, the package.json patch is a bug fix (npm start didn't work before I did this).

thedod commented 11 years ago

There was a discussion on @shacharz hanging on a blame on an outdated diff, so for the sake of convenience, I'm moving the text here:

... stuff regarding submodule misbehaving ...

Note that I've moved the submodule's location @074c4ff from socialshareprivacy/ to socialshareprivacy-master/ (so that zip-installation instructions in the README wouldn't include those cumbersome rm and mv tweaks). This may cause problems if your working directory is "from the @1446de4 era", but here's how to fix whatever the problem may be with the submodule [I hope]: cd to ShareFest/, apply @074c4ff, rm -rf socialshareprivacy (maybe it contains something that upsets git), then git submodule sync (to rebase the submodule) and finally git submodule update --init.

On another note, Do socialshareprivacy have share buttons? We used the share buttons of addthis where you can control the content you are advertising and even private message someone in facebook, as opposed to "like/+1"?

The default in Ssp is indeed a share button (in fact - this is Heise's default, but @patrickcheck decided to use the like button in his demo). The only problem is that since he probably only used the like option in everything he did, the button image for "share" (they call it "recommend") is in German :scream_cat:.

The simplest workaround would be to create an English button ourselves and provide its URL in the settings to the socialshareprivacy() call at ui.js. I already have such a button at my own fork of ssp recommend. I know it says "recommend" (don't remember which fork it came from originally), but maybe it's appropriate for ShareFest. I'll do this right away (expect a commit soon :wink:).

Long term (i.e. if/when this works and you want it):

thedod commented 11 years ago

It's worse than I thought. Patched my code to "recommend", and indeed the button that comes from FB (after the first click) says "recommend", but what it actually does is a like. Worse. I've now noticed the url there was plaintext http: (ZOMG :exclamation:).

I've found @panzi/SocialSharePrivacy (demo). It doesn't support FB share "out of the box", but it has a plugin architecture - so I might be able to add a sharer into it. It also does SSL (if current url is SSL), and seems to be a lot more up to date and feature rich than @patrickcheck's in general. Let's hope it solves the problem.

thedod commented 11 years ago

OK. It's a complete rewrite, and it's much better and simpler now (if you look at the diff, not the commits :wink:). Panzi's original fork didn't have a facebook share button, but it's easy to add modules to it, so I've added an fbshare one, and it's even 1-click.

Hope it's OK now.

shacharz commented 11 years ago

Nicely done, Couple of minor commens:

  1. The g+1 doesn't work (also can we make it a share like facebook?)
  2. We can loose the facebook like After those I'll merge it into an issue36 branch since we still need to make some UI work: placing the share buttons same as in sharefest.me get nice icons and add default content to the share buttons something like "Check out 'filename' on url" so the user won't have to do the entire thing by himself each time. Of course you are welcome to do all of the above and I"ll merge it straight to master :) Oh yea, thanks for all the work.
thedod commented 11 years ago

The g+1 doesn't work (also can we make it a share like facebook?)

I'll take a loook at it. Let's hope that once it works, it looks like "share" and not "like". Worst case, I'll write another module :)

We can loose the facebook like

No problem. BTW, you can also add any of the modules you see at the project's gh-pages site. Except for Delicious, Stumbleupon, and Pinterest (which are SSL-hostile).

add default content to the share buttons something like "Check out 'filename' on url" so the user won't have to do the entire thing by himself each time.

OK.

Of course you are welcome to do all of the above and I"ll merge it straight to master :)

Thing is - I'm color blind and CSS deaf :smirk:. See how I just slapped the share div with absolute position that looked good on my machine.

If you want to change stuff, note that the files under SocialSharePrivacy are auto generated, so don't edit them directly. I've added a README there, explaining what to clone, and the build.sh arguments you need in order to generate the content of SocialSharePrivacy (BTW, build.sh is where you select which button modules you want).

Oh yea, thanks for all the work.

:pray: Thank you for the other 99% of the code. BTW. When I have time, I'm planning a waterproofed branch (would most probably have a demo instance) that tries to minimize the risk of leaking the link to 3rd parties: No share buttons, and if url contains a room id - no external links (chat, etc.) to avoid accidental referrer leaking. Here's a draft screenshot :see_no_evil:

waterproofed-fest

shacharz commented 11 years ago

oops accidentally clicked the "close" button.

I'm planning a waterproofed branch

Looks sweet!

if url contains a room id - no external links (chat, etc.) to avoid accidental referrer leaking.

We should totally take care of that, adding an issue

thedod commented 10 years ago

Latest commit tries to satisfy requests by @shacharz

The g+1 doesn't work (also can we make it a share like facebook?)

Can't get it to work :frowning:. Looks like Google has changed something. Opened an issue regarding this. If you want, I can add some other button instead (maybe reddit?).

We can loose the facebook like

Done

add default content to the share buttons something like "Check out 'filename' on url" so the user won't have to do the entire thing by himself each time.

Done, except for fb share, because it always takes the title from the actual page (without running js on it, of course :wink:), even if you specify the title explicitly.