chatbots load a MediaWiki page - chat

Is it possible in Facebook Messenger, or Telegram, or KiK, to load a MediaWiki page into a Chatbot?
I have a MediaWiki page with a lot of business coaching content.
I would like to create a Chatbot that accesses and displays this content.
Are there any tools for loading a Wiki into a Chatbot? I believe this has been done in WhatsApp: https://www.quora.com/Whatsapp-wiki-service-how-does-this-service-work
Thanks for the help

When you receive a url in telegram, a preview for the webpage is loaded automatically.
For your bot content, you could the callsendMessage function and use the disable_web_page_preview property to control the web preview of urls embeded in your messages.
However, I would suggest that send pre-formatted or pre-cached Wikipedia HTML content as responses to specific user commands/requests to your bot.

Related

Customising a Facebook page - Page App vs. External app with iframe?

Trying to decide between creating a Page App vs. iFrame (Load a hosted page somewhere else like AWS or APP Engine)
I am trying to create a 'tab' on a Facebook page where users can upload pictures to that page for a contest app.
I would like to create some customisation for this contest page.
Hence not using popular off the shelf contest providers like wishpond etx.
The user should be able to view his uploaded pictures on the top layout of the screen while the latest uploads of other users (trending, most liked) can get displayed at the remaining mid, bottom section of the page.
To attain this feature of custom layouting a page, would you recommend creating a 'page app' or create a Javascript based HTML page and host it outside on 'external web server' and render in an iFrame app within my tab ?
If it can be done both ways, would like to hear some adv/disadvantages of each approach.
Hope it explains.
Let me know if I was not clear.
Thanks,
Srik
What´s better is opinionated, but here are the main differences between a Page App (that runs in an iframe on a Facebook Page) and an external Website:
Page Apps don´t work on mobile, so you have to share an external link, check for mobile and keep mobile users on the external link while redirecting desktop users to the Page App.
Page apps are restricted to a width of 810px.

How to do Facebook Open Graph friendly meta tags with client-side template engines like AngularJS, Mustache, Handlebars

According to my testing, Facebook's crawlers do not render client-side templates like a browser.
I want to avoid a webserver and building HTML files for Open Graph objects at all costs. I want to generate the meta tags on the fly via the URL, but it seems Facebook cannot do this.
Can someone from Facebook please confirm? I asked the head of Open Graph at #mobiledevcon and she said that Facebook can render stuff like {{value}}
My meta tags are as follows, and they render fine in every browser. But the Facebook Open Graph Debugger only sees the raw text, not the interpolated content.
<meta property="{{meta.property}}" content="{{meta.content}}">
When you think about it it should be clear, why this does not work.
The Facebook crawler downloads the HTML as it is served by the server. The Facebook crawler will not execute any JavaScript, like all the crawler will not execute the JavaScript. This is due to security restrictions and for speed reason (they do not have the time execute JavaScript on their servers.)
There is no way around this. If you want the crawler to index you page, you need to give them directly what you want them to read.
Tip: You could use something like phantom.js to render your pages on the server side and serve this to the crawlers.
The solution is basically to use some kind of server-side user-agent detection to pick up whenever a social media crawler arrives.
Use the ?_escaped_fragment_ method along with a prerender service. Facebook will respect the same crawlable Ajax specification as Google. Please see https://developers.google.com/webmasters/ajax-crawling/docs/specification

How to fetch the event page from Facebook, NOT just the data

Is there way to display Facebook event page in my website, it should contain all the functionality as there in Facebook.
Using graph API and SDK I can get the content, but I want all the buttons (attend, maybe, etc)
with Facebook design.
You can use Facebook's content but you can't try to make a mirror of the page, which is proprietary.
Use an inline frame (iframe) to display (not copy) the page you want in your own website.
http://www.w3schools.com/html/html_iframe.asp
Could you possibly do a curl request for the page and just output the retrieved call into your site?

Creating a Facebook App

I am building a website for a client. He has a Facebook page for his business. On the homepage of his site, he wants a feed that will pull in all the updates from his business' Facebook page.
Now, I felt this would be very easy to implement (maybe it is) but I have scoured the Facebook API for any simple way to do this. I am having a lot of trouble understanding which way I should do this. I've settled on using JS to access it, but have no idea where to go from there.
Do I need to create an app? If so, which options do I select so I can access the clients facebook page?
How do I get my app that I've created to show up so a user can authorize it? I have so many questions, and Facebook isn't very good at giving me answers.
Any help is greatly appreciated.
I would suggest you just use the facebook page's RSS feed.
Example
Take his page URL e.g.
https://www.facebook.com/pages/Lazery-Attack/6001014870
Take the number at the end of the url off, and plug it into the facebook feeds URL e.g.
https://www.facebook.com/feeds/page.php?format=rss20&id=6001014870
Voila, you now have an RSS feed you can integrate into the website you are building.
URL Breakdown
The URL is broken down the following way:
https://www.facebook.com/feeds/page.php?format={feedFormat}&id={PageID}
Vaid feed formats are:
RSS - rss20
Atom - atom10
JSON - json
Other Examples
Atom
https://www.facebook.com/feeds/page.php?format=atom10&id=6001014870
JSON
https://www.facebook.com/feeds/page.php?format=json&id=6001014870
Take a look at the facebook API, right here: http://developers.facebook.com/docs/reference/api/page/
You can give it a try here:
http://developers.facebook.com/tools/explorer/?method=GET&path=19292868552%2Fposts
The like box: http://developers.facebook.com/docs/reference/plugins/like-box/ also has the latest posts available
The simplest way is to add a Like Button to the page and make sure "show Stream" is checked on as this will show all recent posts. You can customise the appearance also (e.g. width, height etc).
No App or messy API calls needed!
Try it out here and simply paste the resulting code into your webpage:
http://developers.facebook.com/docs/reference/plugins/like-box/
Not an app, but the Facebook Social Plugins over here at Facebook For Pages

Facebook pages question

I have a few questions that I hope some can help with, I am creating a facebook page for a business and they are wanting to display a list of products, that are pulled directly from there own website, is it possible to pull an XML feed from the website, then display the data using FBML? Secondly is it possible to only show certain content if the user has 'liked the page'?
Thanks
You will have to do this with a script on your server. E.g. a PHP-script which fetches the XML and outputs FBML.
FBML has been deprecated so building something with it is risky. It might stop working suddenly.
For showing content only to users that liked you fan page you can use following:
<fb:visible-to-connection>
Content for fans goes here
<fb:else>
You are not a fan, you do not have access to this content
</fb:else>
</fb:visible-to-connection>
For XML displaying of product you will have to build a facebook application that will run in fan tab tab.