Can I use an API key with iframe? - api

Haven't found any content on this, but is it possible to generate an API key and provide it to the partner that would like to incorporate my webapp into theirs? I would like to only allow iframe embedings for authorized partners and not anyone on the internet.
Maybe something like
<iframe src="https://www.wikipedia.org/" API_KEY=12345678></iframe>
Thank you

you could have the partner use the following code to embed your webapp in their page:
<iframe src="https://yourwebapp.com/?api_key=12345678"></iframe>
or
<iframe src="https://yourwebapp.com/" headers="API_KEY: 12345678"></iframe>

Related

How to get URL preview of link shared in tweet using Twitter API?

I'm using the Tweet Lookup API (part of V2). When a user shares a link in a tweet, a preview of that URL is generated in that tweet. I want to recreate this using API. So how can I get the preview image of the URL and also other details like the domain, etc?
For example, if you look at this tweet: https://twitter.com/elonmusk/status/1429907171639103489
If you see the above tweet, there’s a URL preview card, with image of starlink and a brief description of the link. How to get these details through the Twitter API?
I suppose I am a little late, but..!
Unfortunately, to my knowledge there is no way to get the preview image from the twitter API.
You have to find the link from the tweet, get that site and scrape the image from there. Websites can tell twitter what image they want to use by making a tag that has the property "twitter:image"!
--
What you can do, for example, is get the original URL for the post from entities!
E.g. making the tweet look-up like this:
https://api.twitter.com/2/tweets/1532014165686206466?tweet.fields=entities
From there, get the original url, for example from the "unwound_url" in the JSON response of that look-up example.
You need to make a request to that site and from the html response, look for a tag that has the property set to "twitter:image"
In that tags content you have your image link!
See:
https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id
https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
I hope my rambling made sense and good luck!
Unfortunately, this is impossible because Twitter requires URLs with Twitter meta tags in order to show these Links as cards with images. So the only way to do that is to add these meta Tags in the head of your website :
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="LINK TITLE HERE">
<meta name="twitter:description" content="LINK DESCRIPTION HERE">
<meta name="twitter:image" content="PREVIEW IMAGE HERE">
This is how I made it on my own website. I hope that will help you.

How can I add a url (live chat) in a vuejs website?

I've tried different kinds of embeds on my website but it doesnt seem to work. Can I still add a url and show it inside a vuejs website?
Yes we can use. The approach is iframe tag as
<iframe
src="url of live chat"></iframe>
Please use it

How to use google+ share button?

I have created a google+ share button ... https://developers.google.com/+/web/share/ ...
It works but it doesnt share any content ... only appear a pop-up share window => I write something into => and this text it share normal ... but not content of my page/ article ... do you know why?
in my body I have this ...
<div class="g-plus" data-action="share" data-annotation="none" data-height="24" data-href="http://localhost/welcome">ddd</div>
There is 2 kind of Google+ share button.You can use a very simple button to share anything.The properties Google+ gets from meta tags and canonical links.
Here is a link: http://www.w3docs.com/learn-javascript/google-share.html
The share button does not support prefilled text. It only supports sharing the current/specified URL.
The interactive posts API does support prefilled text but it also requires more setup to get working.

LinkedIn JS API Share

I am trying to figure out if it's possible to pass in more than a URL to share when using the LinkedIn JS API.
My code is:
IN.UI.Share().params({
url: 'http://www.example.com'
}).place.();
Now I have tried to pass in other params like:
IN.UI.Share().params({
url: 'http://www.example.com',
title: 'A Title',
summary: 'A Small summary'
}).place.();
But that did wot work. It seems to just ignore those extra params.
I know I can do it using the custom share functionality:
http://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}
But I want to use the JS API so I can get back a token to verify if it was posted properly. With the shareArticle way it takes about 20-30 seconds to actually verify if it was shared using this: (https://developer.linkedin.com/retrieving-share-counts-custom-buttons).
Unfortunately there is no way to do this. The Linkdin Javascript API and Linkdin Share button relies completely on meta tags to scrape information. Such a Pity.
Just set the og: property tags on the page that you are sharing, that way LinkedIn knows that the title, image, etc., fields, are all actually appropriate and right for the site. You can set them like so...
<meta property='og:title' content='Title of the article"/>
<meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
<meta property='og:description' content='Description that will show in the preview"/>
<meta property='og:url' content='//www.example.com/URL of the article" />
Source: LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn.
Works for my site!
You can always use the LinkedIn Poster Inspector on your site's URL to make sure you did it right!

Google Search API with joomla

I would like to implement the google search API in a joomla site. What would be the best way to pass the search query and show the results inside of my templates content area. Making a custom component or there is a lighter workaround?
You could always try RokAjaxSearch as I believe this has the ability to display results from Google. And above all, it's Ajax, therefore doesn't refresh the page.
Hope this helps