News:

Wondering if this will always be free?  See why free is better.

Main Menu

Open Graph topic Facebook

Started by Dhayzon, September 01, 2016, 10:45:48 PM

Previous topic - Next topic

Dhayzon

Link to Mod

Open graph Facebook

<meta property="og:url" content="" />
<meta property="og:type"  content="article" />
<meta property="og:title"  content="" />
<meta property="og:description"  content=" " />
<meta property="og:image"" />


QuoteURl: Topic Url
title: Topic title
description: short Topic description
image: first image Topic or default Settings url img

SHARE LINK ON FACEBOOK  -http://www.yourforum.com/index.php?topic=547600

improve its appearance


http://www.simplemachines.org/community/index.php?topic=547600.msg3884635#new
Powered by Dhayzon! (MIT/GPL license).
This work is licensed under the MIT License

saurabh1938

I was looking for something like this and installed it on my forum but not working for me only the static image is being fetched.

my forum is gotripperz dot com
Visit my forum : www.gotripperz.com

Dhayzon

Image Format

jpg|png|gif

your images are in

?action=dlattach;attach=1031;image


that is not accepted

Jade Elizabeth

This is wonderful, thank you so much! I am getting some errors though..and no images are being added.

Inferred Property
The provided 'og:image' properties are not yet available because new images are processed asynchronously. To ensure shares of new URLs include an image, specify the dimensions using 'og:image:width' and 'og:image:height' tags.

Could Not Follow Redirect Path
Using data from http://www.colormeforum.com/f/strut-your-stuff/rise-shine/?PHPSESSID=b0d3deb10efaf0e15cb50194e250d051 because there was an error following the redirect path.

Could Not Follow Redirect
URL requested a HTTP redirect, but it could not be followed.

Share App ID Missing
The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.

Mismatch og:url and canonical url
og:url tag in the header is not the same URL as rel='canonical' link in the html.


I think the redirect ones will be fixed if you use the canonical, it shouldn't be putting php session info in there to share.

Also for the images, you need to grab their width and height:
https://developers.facebook.com/docs/sharing/best-practices/#precaching

QuoteUse og:image:width and og:image:height Open Graph tags
Using these tags will specify the image dimensions to the crawler so that it can render the image immediately without having to asynchronously download and process it.

Additionally I have a Facebook App ID, it would be really great if you could enable for that.

Thanks for making this!! I hope you can make some changes to make it better :D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

pocttopus

Hello folks,

Does this mod work properly on 2.0.12 version?
Is it available any tutorial for specific installation how to avoid basic issues like why the default image is not working?

Thanks!

pocttopus


Dhayzon

Dear   pocttopus

this mod works in  2.0.12

default url imagen  set on


........./index.php?action=admin;area=modsettings;sa=openGraph;

Quote from: Jade Elizabeth on October 26, 2016, 09:56:07 PM
This is wonderful, thank you so much! ......

not support 100%  for pretty url

working in updates thanks

pocttopus

Quote from: Dhayzon on November 03, 2016, 06:18:34 PM
Dear   pocttopus

this mod works in  2.0.12

default url imagen  set on


........./index.php?action=admin;area=modsettings;sa=openGraph;

Quote from: Jade Elizabeth on October 26, 2016, 09:56:07 PM
This is wonderful, thank you so much! ......

not support 100%  for pretty url

working in updates thanks
Thanks for your response, but I have some issues with this mod.
There is nothing special to configure. The check box is checked but nothing I can see.

The default image "thum_opf.png" is not working.

Dhayzon

whats is your website? and  can you see the error log? if existe any error

Jade Elizabeth

Quote from: Dhayzon on November 03, 2016, 06:18:34 PM
Dear   pocttopus

this mod works in  2.0.12

default url imagen  set on


........./index.php?action=admin;area=modsettings;sa=openGraph;

Quote from: Jade Elizabeth on October 26, 2016, 09:56:07 PM
This is wonderful, thank you so much! ......

not support 100%  for pretty url

working in updates thanks

Oh so Pretty URL is interfering? Hmm. But Pretty URL shouldn't matter because the original links work? Or perhaps I am not understanding how it's interfering?

Glad you're working on some of my suggestions, they will be great updates :D.

Also I do not have ANY OG code added to my forum it seems? It's definitely enabled and my default image is set as well.
http://www.colormeforum.com/f/
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

pocttopus

#10
Quote from: Dhayzon on November 03, 2016, 06:46:41 PM
whats is your website? and  can you see the error log? if existe any error
The web site is mkreef.com
There is no particular tutorial how to work on open graph with smf. It's a big mess using some other things and trying to modify them to the way to implement on a simple machines forum-software. Maybe somewhere there is an explanation but I can't find it. I don't know what files needs to be edited/modified.

Now I have installed other similar mods but it's not open graph. I want to change them because the forum is very slow.
I just want to add "share" and "like" buttons with open graph.

Jade Elizabeth

Have you made any progress to fixing the errors? :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

pocttopus


Jade Elizabeth

I was hoping Dhayzon was looking into it all for us :(.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Dhayzon

I was banned, but I'm getting to work xd

Paracelsus

Hi, This MOD works fine, but in our case it doesn't really fit because we have a feature that allows people to share a single post to facebook (twitter and so on) and the MOD overrides it by picking up the text and image from the first post. If the MOD could be tuned to take into account these specificities it would be perfect.

Jade Elizabeth

Quote from: Dhayzon on December 09, 2016, 05:25:38 AM
I was banned, but I'm getting to work xd

Oh no! What happened?

Quote from: Paracelsus on December 09, 2016, 07:15:00 AM
Hi, This MOD works fine, but in our case it doesn't really fit because we have a feature that allows people to share a single post to facebook (twitter and so on) and the MOD overrides it by picking up the text and image from the first post. If the MOD could be tuned to take into account these specificities it would be perfect.

It shouldn't matter, it doesn't add sharing stuff it just means if people paste the link into FB the info can be grabbed.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Dhayzon

I'm at the university's final exams
wait for me :(

Paracelsus

Quote from: Jade Elizabeth on December 11, 2016, 03:26:25 AM
Quote from: Dhayzon on December 09, 2016, 05:25:38 AM
I was banned, but I'm getting to work xd

Oh no! What happened?

Quote from: Paracelsus on December 09, 2016, 07:15:00 AM
Hi, This MOD works fine, but in our case it doesn't really fit because we have a feature that allows people to share a single post to facebook (twitter and so on) and the MOD overrides it by picking up the text and image from the first post. If the MOD could be tuned to take into account these specificities it would be perfect.

It shouldn't matter, it doesn't add sharing stuff it just means if people paste the link into FB the info can be grabbed.

It adds og meta tags in the source code of each page, which means that if you try to share a post using the direct link to a post somewhere inside the topic then the description, image and etc on facebook will always be the one of the first post (which is not always the intended action).

Kindred

However, since smf does not do a single post on its own page, there is no way to avoid that
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Paracelsus

Quote from: Kindred on December 12, 2016, 10:14:20 PM
However, since smf does not do a single post on its own page, there is no way to avoid that

Isn't it possible to generate dynamic meta tags according to the link in each post?

I found among other links, this one: http://stackoverflow.com/questions/17476699/how-do-i-create-a-custom-facebook-share-dialog-box-passing-parameters

So it should be possible to pass the info we want to share, it just has to be dynamically and not static generated.

Kindred

just so that you are aware...   the OG tags ARE generated "dynamically" -- that is why each page has its own set of tags.

static would be the description, if the tags were the same across ALL pages
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Paracelsus

Quote from: Kindred on December 14, 2016, 08:46:40 AM
just so that you are aware...   the OG tags ARE generated "dynamically" -- that is why each page has its own set of tags.

static would be the description, if the tags were the same across ALL pages

Ok, perhaps I wasn't clear enough on my previous post, what I mean is that it should be possible to generate the correct info to pass on the facebook feed dialog, like grabbing the first sentences of that specific post for the description and the first image in the post for the picture parameter and so on.

Kindred

in short... not with this mod.


What you are asking for is a modification to the individual "share this specific post" mod.

THIS mod adds the OG tags into the header, dynamically, for each *PAGE*. It does not add a "share" button...

So, what you are doing (sharing an individual post) is not even within the design of this mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Paracelsus

Quote from: Kindred on December 14, 2016, 08:56:30 AM
in short... not with this mod.


What you are asking for is a modification to the individual "share this specific post" mod.

THIS mod adds the OG tags into the header, dynamically, for each *PAGE*. It does not add a "share" button...

So, what you are doing (sharing an individual post) is not even within the design of this mod.

Yes, I understand that, was just pointing out that this MOD scrambles/overrides the sharing individual posts functionality.

Kindred

then don't install this mod?

or rather... n  this mod does exactly what it is designed to do (and what the core of 2.1 does)
So, it is, rather, the author of the individual share mod that needs to fix their code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Vince S

Just to ask a potentially silly question, is this mod being supported?

I have been trying to get links to topics in Facebook to display an image rather than a 403 error so installed the mod. On smf 2.0.14, whereas the mod only references 2.0.11 compatibility, despite that 2.0.14 instructions are available.

Discussion about the problem here, lack of responses means it must be hard I guess?
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

luuuciano

#28
Mmmmmm, as I wanted to improve facebook posts shared at facebook... installed this mod, but it does not work as intended...
I have been using a mod to provide inline images... so, tested using a regular img (using the link provided by this image mod): https://cbabikes.com.ar/dlattach/attach.6539/image./ciclismo-urbano/bicicletas-un-beneficio-para-todos-aunque-les-moleste-13461.0.html (oh yes, that is an image... lol)

Any idea how to modify the mod to use that kind of image links?

Or... how to improve posts shared at facebook? images are no properly fetched anymore...

There is any mod to add a OG:IMAGE image, as a field in posts?? did not find...

LOOKING at the code, I found this line:
if(preg_match('/(https?:\/\/\S+\.(?:jpg|png|gif))\s+/',$ogImage,$match))
...
hot to change it to match URLs that has "dlattach/attach" or just "dlattach" on it?

Any regular expression magician here?

UPDATE, asked on an IRC channel and this came up:
         if(preg_match('/((https?:\/\/\S+attach\S+))\s+/',$ogImage,$match))

It seem to do the job.... at least... will test it at fb
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

smartmouse

Does this mod work with SMF v2.1.1?

shadav

Quote from: smartmouse on April 27, 2022, 08:41:56 AMDoes this mod work with SMF v2.1.1?
did you check the mod's page?
QuoteCOMPATIBLE WITH 2.0.11
so then to answer your question...no it is not
and well seeing that
QuoteLast Updated
September 02, 2016,
I wouldn't hold my breathe on an update to v2.1.x

Advertisement: