-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it compatible with actual version of MediaWiki? #1
Comments
Hello @giby ! Thanks for using my extension! Could you please describe exact steps you made to install the extension and behaviour you got?
Thanks in advance. |
Thanks for such a quick answer! I actually had an issue with finding the metadata in the text… Shame on me, I was looking for "first revision author" that was actually replaced by the actual value! So it is working now… I did a little "hack" on your code in order to add custom things… Here is what it looks like:
It should not be that pain to add the few things I did (email, sameAs, legalName… ) Just a question: Why does the LocalSettings.php use a syntax "require_once "$IP/extensions/GoogleRichCards/GoogleRichCards.php";" and not wfLoadExtension( 'GoogleRichCards' ); ? Have you also done anything if someone want to add a meta on a single page? I would like to add a ""@type":"Book"" tag… |
@giby could you please send this as a pull request, we could discuss this right there. Thanks! |
Ho… I would have to make a clean code for everyone then… |
Here's the thing :)
I believe it should be done via dedicated templates or tags within an article(since you probably want to post a number of books, events, products, etc.) so it doesn't look like a part of this extension in it's current view and I have no objections to extend it such way, but no promises on doing that fast. And I missed....
Because it's much faster to do, So I can't see any pros for |
Giving you my source is easy… Sameas:
Well email was in contact point: https://search.google.com/structured-data/testing-tool I could not find "legalName"… I'm sure I found it on the same page… There's a long time I tried to implemant it… Or maybe here http://schema.org/legalName I also saw something for initials for exemple "Cercle Archéologique et Historique de Valenciennes et de son arrondissement" is known as "CAHV" If in some days it is working on google, I'll let you know! Actually, the guide I sent you provides a lot of other features… that I was not in need of… Indeed, the description of "event" or "book" should be done manually… it isn't possible to make it "automatically" for each of them… I actually have no idea about how to proceed… As talking about extention, I was feeling about adding:
But have no idea how to do… I feel a OJS plugin would be more relevant than a mediawiki one… I though that "wfLoadExtension" was the current syntax and that the other was depreciate… Well, I am basically a biologist and not a programer… I make a lot of R coding, and basic help to few project… and also build websites for an association organizing event and selling books about local history… Wish you good night |
So the thing is you need to get this data somewhere from... MediaWiki doesn't support social profiles, so the only easy and reliable way I could imagine is to fetch User: page and look for some markup there. About
Yes and no at the same time :) PS. Please use triple backticks (```) for multiline code snippets. Thanks. |
It sound easy to add in the LocalSettings.php a line like: It does not depend on the user if it is the page related to the whole wiki. I think templates does not fit with what I look for exemple, if I need to put:
|
It depends on what kind of object you're going to describe such way. Here's template invocation from Wikipedia:
It's already contain most of data you need for rich snippet, so why it wouldn't fit for describing books? |
Btw, I just updated the extension with using php-json intead of hardcoded string which should ease your case with adding multiple items since you able now use required data structure to be converted to JSON without any attention to it's format and escaping. |
What I tried to was done following the book richsnipset from google… I'll install the update… Let's see |
Hello @giby ! I've updated the extension in to cover some of your highlights:
I gonna polish the new refactored code for now, but you already could take a look how it's implemented and use the same approach for Thanks for your highlights! PS. I'll try not to stop adding new |
Hi, Here is a little feedback. I used this code:
I have got 4 warnings:
To be clear: Image missing and I cannot get url to be "valide" I tried several ways… The google search engine confirmed:
Is it that I put wrong or something missing? I tried to modify it for getting "book" , but so far; I haven't succeed. Thanks in advance. |
@giby let’s check it out:) Could you please post the resulting JSON/provide a link to that page? |
hmmm… not sure what a json/provide is… The page I'm playing with is:http://www.histoire-valenciennes-cahv.fr/index.php?title=Les_impacts_environnementaux_de_l%E2%80%99extraction_du_charbon_dans_le_Valenciennois_et_le_Borinage_du_XVIIIe_si%C3%A8cle_%C3%A0_l%E2%80%99entre-deux_guerres I wonder if it isn't the / instead of / that is the issue |
the |
the link is enough :) So these two:
are because of really strange behaviour of providing URL as a HTML-formatted link. I gonna check it out.
This one is true, that's because image is not supported based on the code I just checked out, so I'm wondering where you got a field for it? At the same time that happened because there's no clear UX understanding how to add image for that so I skipped it for now in alpha-staged Event extension, but could easily add in the way you used it(but still not sure if that's a right UX expirience for it). |
Thanks @teran, Let me know when it would be working for I download it. |
@giby btw, I just got idea, which editor are you using for your mediawiki installation? |
@giby https://github.com/teran/mediawiki-GoogleRichCards/releases/tag/v0.3.1 is gonna fix your case but it's kinda dirty solution so this needs some refactoring. Please let me know on any issues, thanks for your feedback! :) |
@teran editor? I used filezilla, it isn't an editor as editor I use either Xcode or gedit |
@giby don't worry, I had a suspicion about how the response was malformed, but it wasn't confirmed so nevermind :) |
Great :) Now just 2 warnings left: for the last I made a "|offerAvailability=http://schema.org/InStock" in order to obtain " "availability": "http://schema.org/InStock"," as in the exemple here: https://search.google.com/structured-data/testing-tool Else; I get a small error in the main page: https://search.google.com/structured-data/testing-tool#url=http%3A%2F%2Fwww.histoire-valenciennes-cahv.fr%2Findex.php%3Ftitle%3DCercle_Arch%25C3%25A9ologique_et_Historique_de_Valenciennes_et_de_son_arrondissement there is an extra "," in <script type="application/ld+json">{"@context" : "http://schema.org","name":"Cercle Archéologique et Historique de Valenciennes et de son arrondissement - accueil","headline":"Cercle Archéologique et Historique de Valenciennes et de son arrondissement - accueil","description":"Société savante de Valenciennes",}</script> |
You need to update
I've fixed that in v0.3.2, please take a look how to use it in README.
I've tried to reproduce that on the most recent MediaWiki release, but with no success. Could you please try to disable all the extensions you have enabled except GoogleRichCards to verify this malformed JSON came from GoogleRichCards ? |
All fixed! Now; I'll try to setup the "book" hack! |
remote: Permission to teran/mediawiki-GoogleRichCards.git denied to giby. |
@giby You need to fork the repository first to your account, then create a branch and propose it as a pull request. The error you got from GitHub is mostly possible happened because you tried to push changes to my instance of mediawiki-GoogleRichCards repository while normally should push to your own one. Please refer GitHub help pages for more details: https://help.github.com/articles/proposing-changes-to-your-work-with-pull-requests/ |
Well, I created a branch first, let me fork that! |
@teran Fork done! |
@teran ? Any idea of what is wrong? |
@giby wrong with what? :-) If you done fork to your GitHub account that's right step, so you need to start your developing there(preferably in dedicated branch) and when it's done - create pull request(there's gonna be a button called "compare" or something like that). |
@teran my code crashes, and I don't know why… Here is an issue:
I define twice the same function, but, when I tried to correct it it was still crashing… |
@giby posting code inline even with backticks disables formatting making it unreadable. It's really hard to understand what's going on in the code and how it differs from already present parts. |
I added equivalent of I don't know how to make a correct function for it… |
@giby please, just share the code in readable way(pull request) it's not an issue to take a look and say what's wrong but it's not supposed to be done via comments. In the sample above I see some stuff is commented out there, but I need the whole file to check it out correctly. Please create pull request. |
Can you have a new look? it isn't crashing now, but it is not functionnal … |
Closing because of inactivity. |
Hello,
I tried your extention, but after installation, and cache clearing, it had no impact. The script was not present in the sourcecode.
The text was updated successfully, but these errors were encountered: