Share to Facebook Plugin [inc 1.7.9+]

Post plugins and custom CSS snippets here
dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Share to Facebook Plugin [inc 1.7.9+]

Postby dotdavid » 23 Mar 2013, 19:06

Hi,

I made a Facebook Share plugin by shamelessly ripping off (er, adapting) homolibere's Google+ plugin (hope he doesn't mind). Thought someone might find it useful...

Notes

1) This uses an API that Facebook want to deprecate, but hey I don't want to spend long pandering to their whims and it works for now.
2) I think you need to update the locale files if you don't want this in English.
3) I literally spent 5 minutes on this, so if it doesn't work that's why.
4) I am not exactly quick off the block updating TT-RSS, so if the plugin breaks please PM me.

Installation

1) Upload the contents of the ZIP to the [TT-RSS root directory]/plugins directory.
2) Ensure that you've set the correct permissions on the folder so TT-RSS can load the plugin.
3) Enable the plugin by going to Preferences -> Plugins, ticking the tickbox next to the Facebook plugin and clicking the Enable selected plugins button.

Changelog

v1.2 - Cleaned up code a bit to bring it into line with the newer plugins. Added discussion link. No functional change.
v1.1 - Compatible with the v2 API. Thanks to Shadok for the code :-)
v1.0 - Initial Release

Git Version

Also available on GitHub at https://github.com/dotdavid/ttrss-facebook

Downloads

facebook-1.2.zip
v1.2, cleaned up code a bit, no major changes. Use this if you're using v1.7.9 and above.
(1.78 KiB) Downloaded 1157 times

facebook-1.1.zip
v1.1, compatible with the v2 API. Thanks to Shadok :-)
(1.77 KiB) Downloaded 365 times

facebook.zip
v1.0, compatible with the v1 API. Use this if you're using v1.7.8 and below (why?).
(1.75 KiB) Downloaded 1079 times


- dotdavid
Last edited by dotdavid on 10 May 2014, 18:53, edited 6 times in total.

dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Re: Facebook Plugin

Postby dotdavid » 23 Mar 2013, 19:45

Now I see the two or three other Facebook plugins people have just posted I feel a bit dumb ;-)

Well it certainly shows there is demand!

Suricat
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Mar 2013, 16:49

Re: Facebook Plugin

Postby Suricat » 25 Mar 2013, 17:32

yep, but yours works ! Thanks :-)

dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Re: Facebook Plugin

Postby dotdavid » 27 Mar 2013, 14:44

Looks like I happened to do this the new API way (as I copied the Google Plus plugin from the latest TT-RSS build). We should probably try to get an "official" Facebook sharing plugin added to the codebase if we can.

Suricat
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Mar 2013, 16:49

Re: Facebook Plugin

Postby Suricat » 28 Mar 2013, 01:14

Anyhow, this one's perfect. Many thx !

vincen
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 20 Apr 2013, 13:19
Location: Grenoble, France
Contact:

Re: Facebook Plugin

Postby vincen » 20 Apr 2013, 13:20

Thanks :)

Shadok
Bear Rating Trainee
Bear Rating Trainee
Posts: 28
Joined: 30 Apr 2013, 19:29

Re: Facebook Plugin

Postby Shadok » 15 May 2013, 12:21

I took the liberty to update your facebook plugin to tt-rss v2 api.

Here's the archive.
Attachments
facebook.zip
(1.63 KiB) Downloaded 348 times

dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Re: Facebook Plugin

Postby dotdavid » 15 May 2013, 14:35

Shadok wrote:I took the liberty to update your facebook plugin to tt-rss v2 api.


Thanks! I've made some minor modifications (bumped the version) and uploaded it as 1.1, crediting you ;-)

Shadok
Bear Rating Trainee
Bear Rating Trainee
Posts: 28
Joined: 30 Apr 2013, 19:29

Re: Facebook Plugin [inc 1.7.9]

Postby Shadok » 18 May 2013, 20:14

Glad to be able to help a bit :)

nodiscc
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Mar 2013, 00:10

Re: Facebook Plugin [inc 1.7.9]

Postby nodiscc » 01 Aug 2013, 13:47

Hi Dotdavid, do you happen to have a git repository of these plugins? I use to update my plugins through git (it's easier to track changes on git repositories than checking this thread every month or so). If you don't have one, would you mind setting it up? I can do it for you if you wish, and give you full access - or tranfer ownership to you.

Thanks

dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Re: Facebook Plugin [inc 1.7.9]

Postby dotdavid » 04 Aug 2013, 21:55

nodiscc wrote:Hi Dotdavid, do you happen to have a git repository of these plugins? I use to update my plugins through git (it's easier to track changes on git repositories than checking this thread every month or so). If you don't have one, would you mind setting it up? I can do it for you if you wish, and give you full access - or tranfer ownership to you.

Thanks


OK.

I'm more of a Subversion man myself but I've set up a Git repo with 1.2 at the following location and will keep it up to date.
https://github.com/dotdavid/ttrss-facebook

nodiscc
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Mar 2013, 00:10

Re: Facebook Plugin [inc 1.7.9]

Postby nodiscc » 04 Aug 2013, 22:19

Thanks a lot! this will definitely be useful. Note that if you like working on SVN, you can easily sync both repos http://git-scm.com/book/en/Git-and-Othe ... Subversion

mercier
Bear Rating Trainee
Bear Rating Trainee
Posts: 7
Joined: 19 Apr 2013, 16:41

Re: Facebook Plugin [inc 1.7.9]

Postby mercier » 09 Oct 2013, 09:23

installed 1.10, and installed facebook 1.2 as posted on git.

did not work for me.

solution: in plugins/facebook/init.php

added:

Code: Select all

function api_version() {
return 2;
}

and changed 2 instances of:

Code: Select all

$id = db_escape_string($this->link, $_REQUEST['id']);


and

Code: Select all

$result = db_query($this->link, "SELECT title, link


to

Code: Select all

$id = db_escape_string($_REQUEST['id']);


and

Code: Select all

$result = db_query("SELECT title, link


Hope it will help someone else.

anyway, thank you for a great software.

dotdavid
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 23 Mar 2013, 18:53

Re: Facebook Plugin [inc 1.7.9]

Postby dotdavid » 09 Oct 2013, 22:26

mercier wrote:installed 1.10, and installed facebook 1.2 as posted on git.

did not work for me.


That's weird. I logged on and expected there to have been another API change, but it looks like v1.2 of the Facebook plugin already includes your changes.

https://github.com/dotdavid/ttrss-faceb ... k/init.php has the latest GIT source code which seems to be correct.

Would be very interested to get to the bottom of why your download didn't work though!

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: Facebook Plugin [inc 1.7.9]

Postby sleeper_service » 09 Oct 2013, 23:27

guess he didn't get the latest from git, eh?


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 1 guest