How to get a screenshot and show it to the user after the audit page speed? - pagespeed

I recently working with API page speed google, Now I want to show thumbnail screenshot after the audit. But I don't know how to get a screenshot from the user's site?

When API returns JSON has the lighthouseResult object that includes audits object, you can find thumbnails array in the screenshot-thumbnails.
In this case, I've used:
lighthouseResult.audits['screenshot-thumbnails'].details.items[9].data;
Also, you can get final-screenshot :
lighthouseResult.audits['final-screenshot'].details.data;
Notice: data is base64.

Related

How to get Firebase Dynamic Link URL social metadata itself

Say I have original URL: https://flutree.web.app/NWfLo\
And I shorten it using Firebase Dynamic Link, and set with Social Metadata (image, title, desc), it becomes new URL : https://flut.page.link/hcpa
Now I want to have a Link Preview functionality, I'm using simple_url_preview package. Basically, the package did a GET request of the new URL and parse the og(s) property from the body.
The problem is, it returns the metadata of the original URL, as depicted below:
Behavior that I want to achieve is as below (Example from Telegram's Link Preview, same behavior observed on other major platform ie Twitter, WhatsApp etc):
So, how can I get the metadata of the Firebase Dynamic link itself and not the original/target URL?

Is it possible to get the user mentioned media using Instagram API or RSS feeds?

I want to get the authenticated user's mentioned media using Instagram API.Is that possible to fetch those posts? Besides, as of all of us know that Instagram has released a new feature like multiple image as single post.For these kind of posts we are receiving a gray image as image url and type as video.Can we get all the uploaded image urls or the first image url at least? It looks so bad while showing that grayed picture in our application.
There is no API to get media with user mentions.
For the multiple image, use this as work around for now: https://stackoverflow.com/a/42429285/423089

Facebook Ograph plugin reaps sporadic results

Plugin: Facebook Open Graph, Google+ and Twitter Card Tags
Purpose: The plugin is supposed to provide ograph tags around your posted content. The options set should first point to the ograph image specified in the plugin's added image field. If not found, then the featured image. If not found then the default image (blank.gif for test purposes).
Issue: Sporadic results. Sometimes the ograph image specified appears (after several FB Debugger scrapes. Other times the default image appears.
In all test cases, the suggested image size of 1200x630 px in JPG format was specified in the plugins ograph image field.
FB Open Graph Object Debugger provides me with this:
*
The app (my app id) specified in fb:app_id meta tag is not published
yet. App attribution will be disabled when shared stories are
rendered. Please check the status in the app settings.
*
The FB App ID is specified in the plugin config. True, the FB App Id is not submitted to be published.
Would we need to publish the FB App ID? Not sure since we really aren't developing an app. If we must publish, which screens would I supply?
The domain's DNS is set up with an A record, not a CName. Some research suggests only CName will work - but no mention of that on FB documentation.
Test results:
GOOD
Military test for URL: wels(DOT)net/dev-military/heavenly-math/
BAD
Daily Dev test for URL: wels(DOT)net/dev-daily/20160608/
:) Once I get a solution, how do I get the entire site scraped if I have more than 3000 pages?
Note: Plugin author speaks another language and is inactive on his forum.
Ref.
I found the answer! The permalink structure on our site is domain/postname However, what has been entered into the permalink field (to make each post unique) was domain/post-type/date manually. Post-type is also the archive link.
Since Wordpress permalink structure is domain/postname... the postname MUST be unique. As soon as I added a prefix to the date, Facebook was able to grab the ograph.
Example:
BAD - domain/post-type/date
GOOD - domain/post-type/prefix-date
Why? Because we have multiple CPT's and they were all using date as the postname. Facebook didn't know how to resolve even though they were valid URLs.

How does instagram create huge thumbnails on its user's feeds

I would like to understand how does instagram show large image thumbnails, with each thumbnail having individual actions such as Like and comment. Is it possible to do via the Open Graph API or is this due to Instagram being a property of Facebook?
The custom action and objects API does not seem to allow such a layout. An example is shown below
This is supported by the API via the user generated photos functionality:
https://developers.facebook.com/docs/opengraph/usergeneratedphotos/
has the docs, and you need special approval for your actions
You add the following parameters to your existing publish calls:
image[0][url]=<URL TO IMAGE>
image[0][user_generated]=true
image[1]... etc
{edit:} Actually, i'm not sure how to render that aggregated unit - my answer above is for the photos functionality itself

Error when trying to share an article URL by permalink

Our CMS uses permalink, for example this one:
www.kingmagazine.se/artiklar/king-kroner/20120713/10-korthallare
When a user is trying to share this URL by pasting it into the "update status" field on their Facebook homepage, Facebook seems to try fetch a different URL to get the open graph info, as illustrated in this image:
http://i.imgur.com/NjYM9.png
The page fetched seems to be an error message from the site. The image is not relevant to the article specified but rather contained in the footer of all pages.
However the CMS also has internal URL:s, such as this one (for the same article):
www.kingmagazine.se/artiklar/?id=152539
When sharing that one on Facebook, the correct data is fetched, as illustrated here:
http://i.imgur.com/wV5q3.png
I have tried digging in our server logs to no avail - it seems like Facebook is requesting the wrong URL and not the complete permalink. I have also tried the Facebook Lint but haven't found any reason.
Has anyone got any ideas?
Sorry for the garbled links but Stackoverflow spam prevention said max 2 links and no images. :(
Just wanted to get back to this question if anyone else has the same problem, as we eventually found the solution.
The reason of the faulty information on Facebook was that the editors in the CMS had a preview function which showed the article as rendered to the visitor. These pages (as they included the site header/footer) also contained Facebook like buttons through the Facebook social plugin.
This meant that Facebook was 'pinged' of the article before it was actually published as the editor was previewing the changes. When Facebook tried to fetch the article, an error message (with an incorrect HTTP status code I might add) was returned which Facebook then cached.
Silly enough. :)

Resources