Part of my application are URLs that can be embedded in other sites much like a banner ad. Here is
an example.
That page is generated on-the-fly with the latest data to update the pie chart in it -- in other words just a normal JSF page. The links in it work and does what I want it to. This is OK for web page developers, since I can generate an iframe tag for them with the src attribute pointing to that URL.
What I would like to do is generate a URL and HTML code fragment that could be cut and pasted into other web pages and user forums so that the image is shown in the page, not just a link to it. Most user forum software will allow this but not allow inserts like iframe. For example the following doesn't work here:
<iframe src="http://www.myqwip.com/banner.xhtml?windowId=5b5&width=300&height=400&qwipID=2" width="300" height="300"> </iframe>
I think in order to do this I would have to provide a URL that serves a JPEG or PNG file on the fly, so the image could be displayed elsewhere. Most user-forum software allows such hot-links.
I have been looking for a way of doing this. Any suggestions?
Related
I once saw in a tutorial video about an HTML line of code that generates random images that it fetches from the internet and puts into the webpage, I remember it being a normal img tag but inside the ref attribute contained a link that now I don't remember what it was.
Searched about this in Google but all I could find was about loading images from the directory or using the help of Javascript.
This is possible by delegating the randomness to the server that serves the images. Consider the service provided by PlaceIMG. Setting any <img/> tag to one of their URLs will let your show a "random" image. What is actually happening is that the backend gets a request for an image and serves any image it wants.
You can do this with your own, self-hosted image server and in basically any server-side language and without client-side JavaScript. However, there has to be logic somewhere to do the randomness:
<img src="https://placeimg.com/640/480/any" />
There are many sites that serve as random image source, for example https://picsum.photos.
Working example (refresh to see the effect):
<img src="https://picsum.photos/200">
I have a page which contains an animation that is embeded in thousands of websites where the company I work for run ads.
However I would like to embed this animation in the website of the company that I work for because they produced the animation (of course). When our ad-partners embed our animation they use an iframe pointing to
http://example.com/pagina_animacao/
So I created a page inside the company I work for's domain containing this exactly iframe:
http://example.com/?q=aceitar-contrato-criacao-site
Because this iframe can be considered as duplicate content (it is published at /?q=aceitar-contrato-criacao-site and at /pagina_animacao/) I went to the URL /pagina_animacao/ and configured the canonical tag as:
<link rel="canonical" href="http://example.com/?q=aceitar-contrato-criacao-site"/>
Is this the right thing regarding canonical standards to avoid having duplicated content?
After waiting some time to Google crawl this website I took a look at the report and indeed, the URL https://www.sitepor500.com.br/pagina_animacao/ is not being listed anymore as an indexed URL \o/
I also used SEARCH CONSOLE (tool from Google) to see what Google was seeing at https://www.sitepor500.com.br/?q=aceitar-contrato-criacao-site and it crawled this page CONSIDERING the content of the iframe! I just did a search at google by:
site:sitepor500.com.br "semantic ui"
And Google showed at the result the link that CONTAINS the iframe! \o/ I used the word "semantic ui" cause that 2 words only appears inside the iframe in my entire domain. So it's a pretty good test case!
So you CAN and you SHOULD use canonical tag inside iframe cause people MAY embed your iframe in external content and your iframe content will probably appear as duplicated content!
I am currently developing an iPhone app showing the contents of sports related articles available in my website. Each article contains one title, one picture and some content. When I refer to the content I include the text of the article, the youtube videos that can be here or not, the link refering to other articles that are or are not in my website (depending on the article) etc...
In the first version of my app I had two screens. The first one was a customized UITableView looking like this :
Then when I clicked on an article I had the article open up in a second screen like this :
I retrieve all of the data I need by calling a PHP file that it making a MySQL request to my server's database and then sending the data back to my app via JSON. The problem I have is that the content of the article is given in HTML and I cannot parse it so it can be dynamically used. For instance when there is a link to a website I'd like to have it clickable. When there is an embeded youtube video I'd like it to be viewable inside of my app. In order to accomplish that do I have to use a UIWebView ? (Note that I don't want to show the article page from the website directly into the app. I want to be able to customize it anyway I want).
You will need to take take the HTML content from your JSON. If you have valid HTML, you can simply load it in a UIWebView in your view using the following call:
[self.webView loadHTMLString:htmlString baseURL:nil];
Short of writing your own HTML parser, this is you best bet. So you view can have static UIImageView and UILabels for the title and image, and a webview that will display your HTML (which can be customized however you'd like).
What code elements do I need to add/modify on a Web page to ensure that it gets embedded properly on a facebook status update?!
See below for an example of what I think is a good embed:
Some web pages I tried to embed don't appear very well on facebook i.e. when you put their links in a status update. Also, sometimes it gives you a selection of images to choose from?!
Is this purely a <meta> tag play, or are there other things I could do to ensure that the web page gets embedded the way I want it to (images and all)?!
Thanks.
Yes this is meta tags at work. You need to specify Open Graph metadata to define what appears on Facebook. See http://ogp.me/
I am creating a web page that accepts a hyperlink from the user and displays that page in an iframe. While rendering the page, I would like to show just the text and simple colors, thats it.
I would like to block all the media files like images and flash scripts from showing up.
If not an extensive one, for the starters, I would like to confine the scope to .gif, .jpeg, .jpg, .png, .swf.
Or does anyone know of a site with similar functionality?
You can write a simple dom parser and parse the page before show it in iframe. Then before showing it you can remove whatever you want.
your iframe whould like
<iframe src="your_parser.php"></iframe>
In your parser you can get the content from page using file_get_contents() or curl() it is your choise (i would use curl). Then you can remove the media you want.
If you're using Firefox, use the Adblock Plus extension. You can specify the types of items to block via a filter rule. An example (using Safaribooks) looks like this:
||techbus.safaribooksonline.com/static/201109-2191-techbus/images/6.0/*.jpg
However, if you're talking about incorporating functionality into your page to strip out a specific list of content-types, this approach wouldn't help you. You'd need to pull the html source and strip out the offending content-types.
also if you are using cms. you should be turn off bbcode image, and embed html