How to render whatsapp content in preview dynamically? - social-networking

I have an application where i use dynamically rendering of meta tags. I am using pre render services to render meta content dynamically. It works for facebook, google..etc but for whatsapp it is not able capture dynamic content. It is showing like {{meta.content}}.
How can i remove preview from whatapp while sharing from js?
Is there any solution to capture preview dynamically?

If you want to render dynamic content that you need take help of .htaccess.
RewriteCond %{HTTP_USER_AGENT} facebookexternalhit/1.1|Twitterbot|Pinterest|linkedinbot|WhatsApp|Viber|SkypeUriPreview|Google.*snippet [NC,OR]
For more info:
https://gist.github.com/thoop/8072354
https://www.winhelp.info/create-browser-whitelist-with-htaccess.html

If you are using Prerender you just need to add the whatsapp user agent to the list of user agents being checked. Whatsapp does not support the escaped fragment crawling protocol.

Related

Render personal tabs dynamically in Ms-Teams using custom application

I have created custom application with static tabs defined in manifest file and it is working fine.
Now, our requirement is that we need to render static (personal) tabs dynamically according to provided Site URL by customer.
For ex. When application installed in teams user will get screen where he will asked for Site URL (API) in textbox and submit it. This will internally check data and give response with tab name, tab URLs and other details then I need to render this tabs dynamically in teams.
enter image description here
Please provide solution for this how I can achieve this ?
It is not possible to add static tabs dynamically. Static or personal tabs are always added through the app manifest and are common to all the users using the app. If you want to configure what tabs to show you can try using a channel tab.
As Gousia said, you can't set the contents of the tab dynamically, and you can't add/remove personal tabs programmatically, but what you could try is having your "tab" be just an iframe host, with width/height basically set to 100%, and then dymically loading the content of the iframe

ngRoute for Single Page AJAX app and Google Search indexing

I read numerous resources on using ngRoute html5Mode (true) in AngularJS Single Page Applications (SPA) to facilitate Google indexing of the AJAX SPA app. I still have a following question.
Setup:
I have set up server redirection which redirects browser for URL which are not found to the root of my AngularJS app like so:
RewriteRule ^(.*) /SPA/index.html [NC,L]
I also verified in Google Web Master tools that Google can access, index and correctly render individual page using direct url like this http://braginski.com/SPA/about
this page is a referenced in index.html like this:
a href="#about"
Question:
Now since I verified that Google bot can render my Ajax app correctly, can I just submit XML site map to Google with all URLs which I would like to index? This site map will include all URL in the conventional form (no #, no !), like so:
/SPA/about (full URL http://braginski.com/SPA/about)
Google will then index each URL (my redirection will ensure that each URL like /SPA/about is routed to root of AngularJS app for proper rednering). This way I don't have to deal with escape_fragments or any other middleware pre-rendering?
Thanks

Include an image into a "mailto" mail?

The title might not be clear - I'm creating an app in Unity and I want it to start the device's default mail client to create a new mail. I can easily do that with mailto. What I don't know how to do is include an image in the mail being composed. In any way: as an attachment, as a part of the mail body or whatever. But it's a local image, so I can't just put a link to it in the mail.
Is it even possible? If so, how?
I doubt if you can do it as the mailto page doesn't mention this as one of the parameters.
At best you can add body and subject.No attachments I suppose
See http://www.faqs.org/rfcs/rfc2368.html
However a hack you can try is in the body that you include
add <img src="your image src"> and hopefully the mail client will recognise this as html markup and render the image when the client opens up.
I haven't tried this though.

How to capture screen application to .jpg and post it on wall

now i'm making application for facebook with javascript.but I don't know method to change my screen application to .jpg file.
So,I would like to know how to change my application and post it
Thank you for your help.
You cannot get the screenshot done client side, however you can grab the HTML code of the page being viewed and AJAX it up to your server, have your server component transform that HTML into an image.
Use this to get the HTML content of the page at the moment they want the screen capture document.getElementsByTagName('html')[0].innerHTML;
AJAX the HTML to your server
Have your server transform that HTML into an image (depending upon server-side technology you're using, there are solutions to this) (eg http://www.converthtmltoimage.com/)
two choice, store the image on your server to be the permanent place sending back the new URL for the image, or send the content back to the client.
Have the client HTTP Post the image content to Facebook for the post, or reference the URL
It's a big project, but I commend you for tackling something like this.

plain http image on https/ssl page = warning

I've found the page that plain http images with a https/ssl page can't be displayed without warnings. Are there any way to display a picture from another http:// web-site on your https://web-site without warnings? (suppose you have a permission to display that picture on you web-site).
Chrome put a yellow triangle on SSL locker: "...However, this page includes other resources, that are not secure..."
IE displays a warning when a page loads: "Do you want to view only the webpage content that was delivered securely?"
So, how to display a picture on https:// page if it is on another web-server?
You can use the information on this article on Encosia. Basically you have to use a // syntax for your urls in order to use the same protocol in all cases. For example, if you have a https request, the following
//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
will hit google's CDN using the https protocol. However, if you don't have control over the other server, i think you're out of luck. If you do have control over the other server i'd recommend using the method described in the article above by allowing your content server to serve both protocols.

Resources