![]() |
A BB Code to use og: metas
Folks-
I want to use the og: data to display links to external pages. I thought I could make a BB code that uses javaScript to go get the info. It turns out I can't (at least without some help). It has been many ears since I tried to write javascript—and I'm really rusty. First, I tried: Code:
function getMetas (theURL){ When I tried: Code:
function getMetas (theURL){ Am I missing something small or am I on a fool's errand? Any helpful hints you can share? |
Well, I'm not a javascript expert so I don't know exactly why that isn't working. You're probably right that it's because the document hasn't loaded yet. But I'm not sure that having a user's browser load the page in a separate window every time one of those links is in a post is a good idea. Anyway, I did 5 minutes of research on the subject so I'm obviously not well informed, but it seems like there is a function that will create a new document from a url, but it's only in newer browsers. But without using that, I think you could parse it as XML or even just as a string, instead of loading it into a DOM object.
Doing a search for "open graph protocol parsers" I notice that there are parsers for php, so you might be able to figure out a server-side solution. Maybe when the post is being saved check it for one of those bbcodes and if it's found, parse the document for the og data and do a replacement. But I'm not sure what would happen if the user wanted to edit the post later. |
Quote:
Quote:
Quote:
Thaks for your help. |
All times are GMT. The time now is 03:51 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|