Use AIML for Page Redirection - chatbot

I am developing an AIML chatbot using Program-O. Is there any way i redirect to a link mentioned in the user input. As in can i use the href attribute inside AIML? For example:
<category>
<pattern>Go To google.com</pattern>
<template>Can i put something here to redirect to google.com?</template>
</category>

Using system element we can do that .
assuming that your using windows...
<category>
<pattern>Go To google.com</pattern>
<template><system>start "http://www.google.com"</system></template>
</category>

Related

Multiple conversation with different users in AIML

So what i want to do is to make a conversation between bot and a person, but the bot in the end must have at least 3 conversation between different persons. I was looking a lot for this but i cannot find anything that works.
Can somebody help me explaining how can i make multiple conversations between a bot and multiple users?
Bots developed in AIML aren't totally stateless as they can save per-user information while interacting with a user.
Your bot as a whole can interact with N number of users as there are no such limitations to AIML bots.
If you are saving variables using Set tag
<set name = "variable-name"> variable-value </set>
<category>
<pattern>I AM *</pattern>
<template>
Hi there <set name="name"> <star/>!</set>
</template>
</category>
Then it maybe stored for that particular user or as a global variable depending on the implementation of AIML specification you are using.
I am not much of an AIML expert but I do have used SIML for bot development.
In SIML however per-user information or variables are stored separately in the following fashion.
<Model>
<Pattern>WHAT IS MY NAME</Pattern>
<Response>Your name is <User Get="name"/></Response>
</Model>

Share count in amp-social-share

I'm using amp-social-share for implementing social share on my amp page. I would like to get the share count. But I couldn't find any proper methods in amp docs related to this. Is there any method to get social share count in amp pages?
The amp-social-share component cannot display share counts.
Currently amp-social-share does not do any communicating with the social platforms in regards to share counts or other data. Social share only uses endpoints for each platform (which you can see in the default config) to add sharing functionality.
The solution below is a work-around to update both view-count and share count. I will use amp-list to update view and share count
Maintain an amp-state with a GET API end-point to update share count and name the state as you wish(I name it share).
Place amp-list at the starting of the body because amp-list starts rendering when the html tag is about to be visible on the page :p
<amp-list id="myList" src="your API end-point to update view-count" [src]=do.url>
<template type="amp-mustache">
</template>
</amp-list>
<amp-state id="myState">
<script type="application/json">
{
share:{
"url":"your API end-point to update share-count"
}
}
</script>
</amp-state>
Finally, In the amp-social-share tag, add role="button" on="tap:setState({do='share'})" to the element.
This way you are in a position even to share-count of a particular social media platform your article was shared.
Reference : https://amp.dev/documentation/examples/components/amp-list/?referrer=ampbyexample.com

Where on the website should I put RDF/XML Schema.org code?

I'm trying to put Schema.org on a website. First I made JSON-LD but the website is not allowing any script in the head element. Then I converted it into RDF/XML format below.
Now, where on the website should I put this for Google to read it. Should I put in the head element?
<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:schema="http://schema.org/">
<schema:Organization rdf:nodeID="genid1">
<schema:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">National Public Radio</schema:name>
<schema:sponsor>
<schema:Organization>
<schema:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">GloboCorp</schema:name>
<schema:url rdf:resource="http://www.example.com/"/>
</schema:Organization>
</schema:sponsor>
<schema:url rdf:resource="http://npr.org"/>
</schema:Organization>
</rdf:RDF>
If you want to include it in the HTML document, you would have to use a script element (just like with JSON-LD). This script element doesn’t have to be part of the head, you can place it in the body. An alternative is to provide the RDF/XML in its own file and link it from the head, or offer it via content negotiation.
That said, Google Search doesn’t support RDF/XML. For their search result features, which make use of Schema.org, they only support these syntaxes:
JSON-LD (in script)
Microdata
RDFa

Using canonical url & passing variable

I'm building a share system for a website, using facebook like & addthis.
Example,
member_ID 177 shares a product page "http://www.example.com/product.php?item=swedish-fish&member_ID=177",
someone click through the link and the page registers "member_ID=177" as the "referrer" for the item, to receive rewards.
if so, every members' page "http://www.example.com/product.php?item=swedish-fish&member_ID=..." will be different. And share cannot compound.
Using canonical url doesn't seem to help, as I still need to pass "member_ID=177".
Basically, What I want to achieve is share
"http://www.example.com/product.php?item=swedish-fish&member_ID=177",
but compound the "likes" & "share" numbers on
"http://www.example.com/product.php?item=swedish-fish"
<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish"/>
<meta property='og:url' content='https://www.example.com/product.php?item=swedish-fish' />
Is it possible? If so, how? If not, any suggestions on alternatives?
Thanks in Advance!
You have to add the &member_ID=177 to the og:url tag, and the rel='canonical' tags for this to work. If you don't Facebook will aggregate all the different member ids as though they were one URL.

I want to create fshare for each mp3 song on a single page .? How to use meta -tag for this ?My project is in jsp

I am using the code from this page
https://developers.facebook.com/docs/share/
Update
I'm a php programmer but the solution is easy make different unique url addresses for a single page by using Get method look at this
example.com/index.jsp?name=akon&description=new%20song%20from%20Akon
you can set this as share button's url for first song
& second one
example.com/index.jsp?name=usher&description=new%20amazing%20song%20from%20Usher
Then make codes like this (I'm php programer but its easy to know what the code is doing)
<meta property="og:description" content="<?php echo $_GET['description']; //// This code gets information from url and shows them ?>" />
can you explain more ? you want to use some share buttons on a single page for different mp3's with unique urls?