How to hide url while displaying image in telegram chatbot? I am developing a chatbot using AIML in program-y interpreter which is written in python
This is my aiml code
<category>
<pattern>SHOW ME YOUR PICTURE</pattern>
<template>Okay </template>
</category>
It is displaying image along with url here is the image below
Url displaying along with image
The url displays even while using <image> as well as with <img src></img> tag.
I want to display only image whenever user asks. Is there any way to hide image url while displaying images in telegram?
Your interpreter needs to support the rich media elements of AIML 2.1
In this case, the <image> tag
<category>
<pattern>SHOW ME DONALD DUCK</pattern>
<template>
<image>https://static.wikia.nocookie.net/disney/images/d/db/Donald_Duck_Iconic.png</image>
Here you are.
</template>
</category>
Related
I am using Tinymce as an email editor. When inserting an embedded image as attachment, the images are inserted as:
<img src="cid:mycid#sth" />
This works for the email sending part - but of course not for the editor. The image is not displayed...
Question: Is there a "content" and "display" layer in Tinymce where I can hook into?
My goal is to save the content as
<img src="cid:mycid#sth" />
and transform it in the editor window as
<img src="/mypreview/image/2000" />
I am using Tinymce 4.
The editor relies on the browser for the rendering of HTML so anything like your <img src="cid:mycid#sth" /> won't render in the editor - its simply not valid HTML.
What you can do is rely on data-xxx attributes in HTML to store the data you really want and transform the HTML when you go to load it into TinyMCE.
For example...
When someone inserts the image you could create the following HTML
<img data-src="cid:mycid#sth" src="/mypreview/image/2000" />
...this would allow the editor to actually render an image while you still keep the data you need. When you save the content you can strip out the existing src data and copy the data-src content back into the src if that is what your app needs for its server side processing.
If someone edits the content you can just reverse the process and change the src back to HTML that TinyMCE can render.
I have a Tumblr and where are my Home and Ask links I want to put a PNG image with the words of the font I want. But I want the link to redirect to what I've originally put in the links of the blog. What should I add in the HTML to manage do that?
This is possible.
What you can do is create your png images and then upload them to tumblr here: http://www.tumblr.com/themes/upload_static_file
Make a note of the file link. Then in your theme you can code the links to have images instead of text.
This will depend on your theme to some extent, but it could look something like this:
<a href="/">
<img src="http://static.tumblr.com/yourfile.png" />
</a>
<a href="/ask">
<img src="http://static.tumblr.com/yourfile2.png" />
</a>
I'm trying to use Twitter's gallery card to show off a Tumblr photoset. This is the relvant portion of the code, and everything validates just fine with Twitter:
{block:Photoset}
<meta name="twitter:card" content="gallery">
{block:Photos}<meta name="twitter:image" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image0" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image1" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image2" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image3" content="{PhotoURL-500}"/>{/block:Photos}
{block:Caption}<meta name="twitter:title" content="Photo Gallery"/>{/block:Caption}
{/block:Photoset}
However, if you look closely you may see my problem. I can't figure out how to get unique URLs to each image. {PhotoURL-500} always just returns the same image. According to my apparently incorrect reading of the Tumblr docs (http://www.tumblr.com/docs/en/custom_themes#photoset-posts) it seems like {block:Photos} within {block:Photoset} should cycle through.
What am I missing?
Also - yes, I'm aware I've hard coded the content for twitter:Title.
It isn't possible as of right now.
The issue is that {block:Photos} will iterate over each photo and render the markup inside that tag, but you can't manually control that to pinpoint a single photo.
What your code is doing is that for each photo it renders the Twitter markup 4 times; it wouldn't be a problem if Twitter accepted multiple images without requiring them to be explicitly declared like image0, image1, etc like OpenGraph does (what you want is possible with OpenGraph, just put a single meta tag in a Photos block and it'll be rendered for each photo), but looking at how Twitter is being more and more hostile towards developers leaves little hope for a fix on their side.
i have gwt app, and one of the 'page'(or display) has a iframe whose url point to google web page, however when deploy the app, google page doesn't show up. here is the code
<g:HTMLPanel styleName="{style.ctntBox}">
<div id="contactForm">
<g:Frame url="http://www.google.com/"></g:Frame>
</div></g:HTMLPanel>
if i replace the google webpage with a static image stored locally, it show up fine:
<g:HTMLPanel styleName="{style.ctntBox}">
<div id="contactForm">
<g:Image url="img/myImg.jpg"></g:Image>
</div>
</g:HTMLPanel>
can anyone tell me why it won't work with external link? Thanks
Answered on the GWT group: https://groups.google.com/d/msg/google-web-toolkit/nwlTBBVGJSA/pho1SVeviQEJ
Copied here for convenience:
Google refuses to be displayed in a frame using the X-Frame-Options HTTP header.
See http://code.google.com/p/google-web-toolkit/issues/detail?id=7055
The code you provided creates the UI, including the frame, just fine. The thing you're not doing is setting a height and width for your frame, so it's effectively invisible. Change your code to the following and you'll see your frame.
<g:HTMLPanel styleName="{style.ctntBox}">
<div id="contactForm">
<g:Frame url="http://www.google.com/" height="150px" width="150px" />
</div></g:HTMLPanel>
The reason you didn't have to specify the height and width for an image is because they are implicitly defined by the image itself. There's no way for GWT to know how big you want an iframe to render on your page, so you have to explicitly set the size.
What is different of having a facebook share button just by having an anchor tag:
<a href="http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>">
<img src="custom.jpg" />
</a>
than having one with the javascript provided by FB follow by the anchor tag?
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
I just want to verify I'm not missing any of the basic functionality of sharing a link by using the anchor tag only because I want to use the anchor tag way to customize my button image.
The end result of the share is the same, as when you click the button it ends up taking you to the same endpoint. The difference is in how the button looks (and the count that shows up if that's the layout you've chosen).