Expose AJAX application to Google - ajax

I have one big web app that is basically one page where every content is created dynamically. It also has a forum, how do I expose the forum to Google or other search engines? Should I create a seperate view of the forum especially designed for search engines?

Use meta tag in your html. This metadata can be used by search engines (keywords).
<meta name="description" content="xyz your web site name etc">
<meta name="keywords" content="xyz your web site name etc">
<meta name="author" content="xyz your web site name etc">

Related

In custom adaptor, where is the file's title property I have to set?

I'm making custom file adaptor using adaptor library.
In my adaptor getDocContent(), I retrieve file from URL, and set the content to the Response's OutputStream like sharepoint connector do.
So, I thought "Where is the file's title property I have to set? This is just a content."
As I was thinking, the file does not hit by it's title on the GSA search API. Also by File Extension Filter.
When developing a connector for Google Search Appliance using the Adaptor Framework, you have a few options on how to display metadata. You can send metadata via HTTP headers, but this lacks somehow. For example, when your metadata is too long, it will get truncated (because of it's size).
Since some time we use Handlebars for templating in GSA connectors. You pass your retrieved object to Handlebars, after which you can compose an HTML document such as following:
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="{{object.description}}"/>
<meta name="filetype" content="{{object.filetype}}"/>
<title>{{object.title}}</title>
</head>
<body>
<h1>{{object.title}}</title>
<p>{{object.description}}</p>
<p>{{object.someMoreContent}}</p>
</body>
</html>
So when you getDocContent method is invoked (usually, when GSA crawls you connector), it will crawl the page you design with HTML and HandleBars. Very straightforward and easy to maintain!

Launch Win8.1 Store App with msApplication-Arguments

Has anyone successfully used the msApplication-Arguments meta tag to launch a Win8.1 Store app with arguments? Once I add the msApplication-Arguments meta tag to my HTML code, my app fails to launch from the IE Store app.
Here is the MSDN documentation for launching a Store app from a web site via IE Store app.
http://msdn.microsoft.com/en-us/library/windows/apps/hh781489.aspx
Here are my meta tags without my actual app ID and package name.
<meta name="msApplication-ID" content="myAppId" />
<meta name="msApplication-PackageFamilyName"
content="myMicrosoftAppBuildPackageName" />
<meta name="msApplication-Arguments" content="myArgs" />
Found the issue...msApplication-Arguments meta tag does not work from a static HTML file. If the HTML is run from a web server, everything works as described by the MSDN documentation.

Twitter cards - Failed to get a proxied URL for the image

From time to time Twitter Card Validator shows an error for twitter:image:src - Failed to get a proxied URL for the image.
Domain is approved, robotx.txt is present in web root. Twitterbot successfully retrieves robots.txt, web page and image, but image is not shown in the Twitter Card.
Source page: http://www.bluefountainmedia.com/blog/how-to-create-great-content-for-your-business-blog/
Twit: https://twitter.com/mstzfort/status/363004775891087361
Metatags:
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="#BFMWeb">
<meta name="twitter:url" content="http://www.bluefountainmedia.com/blog/how-to-create-great-content-for-your-business-blog/" />
<meta name="twitter:title" content="How to Create Great Content for your Business Blog">
<meta name="twitter:description" content="In case you hadn’t already noticed, 2013 is all about content. Check out 7 content Ideas (+1 bonus) to help come up with great content for your business blog.">
<meta name="twitter:image:src" content="http://www.bluefountainmedia.com/blog/wp-content/uploads/2013/06/Business-Blog-Content-197x110.jpg">
So, the question - how to show images in twitter cards?

Single Page Applications and Open Graph

I'm writing a SPA that uses underscore templating. The app searches for and rates music albums and returns the result via ajax. If facebook open graph metatags cannot be altered dynamically and the url of the page is constant regardless of search result, how can i make it so users can share that they rated a certain album.
ie)
<meta property="fb:app_id" content="118454308341351" />
<meta property="og:url" content="http://www.appurl.com" />
<meta property="og:title" content="Fleetwood Mac's Rumors" />
<meta property="og:image" content="AppImg.jpg" />
and update those properties to reflect a given search result.
The way I handle this is to create a dynamic page which I use as my open graph object, which is simply populated from the url parameters and redirects back to my SPA using the meta redirect.
<meta http-equiv="refresh" content="0;URL=http://YOUR_WEBSITE_WITH_DYNAMIC_CONTENT">
Thanks to this tutorial I found a solution: https://speakerdeck.com/sienatime/facebook-sharing-for-single-page-apps?slide=15
I send only meta tags if the user-agent of the http request includes "facebookexternalhit".
Here is some code for a backend with node and express:
app.get('/', (req,res) => {
if(req.header('user-agent').includes('facebookexternalhit'){
res.send(`
<meta property="og:title" content="The Slits' Cut" />
`);
} else {
res.sendFile(index.html);
}
})
You could also write your own middleware for that.
Our solution was to use Netlify pre-rendering, which pre-renders and then caches the rendered HTML to serve to crawlers and bots specifically.
This seems to work well. It allows us to dynamically update the OG meta tags, which are then cached by Netlify and served to crawlers, so they see the correct content.
It was easy to setup too, so if you are using Netlify this may be a good solution for you.

Facebook button for Ajax Pages, how to implement and verify that it works

I wanted to know how can I use Facebook Like button on my Ajax web application, that will capture changes in the Open Graph tags for both the og:title and the og:url. I already created a Facebook app and got an API ID.
What I want to know is the code that I need to put on my website in order for Facebook to capture the changes that I've made to the meta tags which contains that title and url information (ie. og:title, og:url).
I followed the instructions on Facebook without success. Furthermore, I want to know how can I locally test the Like button to see that it grabs the data from the Open Graph tags properly.
Also worth mentioning that I've a JQuery code that automatically alters the Open Graph meta tags to include the relevant information for the current Ajax changed page.
Thanks.
You will need to have a separate url for each different page that you want to allow people to like. I would recommend actually pointing the like button to the physical pages you're trying to return via the og:url tag. To refresh the data that Facebook stores about a given url, pass that url into the linter at http://developers.facebook.com/tools/lint.
i created a rotator file for facebook share on my dynamic ajax website.
rotator.asp code sample:
<html>
<% lang=request("lang")
id=request("id")
..some sql to get data...
ogTitle=....
ogImage=....
originalUrl=....
%>
<head>
<meta property="og:title" content="<%=ogTitle%>" />
<meta property="og:image" content="<%=ogImage%>" />
.....
......
<meta http-equiv="refresh" content="0; url=<%=origialUrl%>" />
//dont use redirect.. facebook dont allow 302...
</head>
<body></body>
</html>
for example xxx.com/#!/en/153 page will share xxx.com/rotator.asp?lang=en&id=153

Resources