How to get plain html content with images from wikipedia API - javascript

I am trying to get html content with all images from wikipeida using wikipeida's official API. Currently, The api i use only return html content
This is what i am Using
https://en.wikipedia.org/w/api.php?action=query&prop=extracts&titles=google&format=json&origin=*
Thanks in advance 🙏

You can get text and images using the following query example
https://en.wikipedia.org/w/api.php?action=parse&prop=text|images&page=google&format=json&origin=*
Then for each image, you can get the url, which can be used to download the image. For example
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&titles=File%3ASemi-protection-shackle.svg&iiprop=url
Another example to get urls for all images on a page
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&rawcontinue=1&titles=google&generator=images&iiprop=url

Related

Load image from external http URL using fo:external-graphic XSL

I'm trying to use load images using fo:external-graphic XSL.
I tried few sample code.
sample-1
<fo:external-graphic src="url('abc.jpg')" width="340px" height="238px"/>
If i use static image directly..then It's working
sample-2
<fo:external-graphic src="url('http://220.226.207.170/mcraftuat/storageservice?a=readfile&databasename=mco&blobkey=f251fcf9-afa1-49cb-9a48-093cc0af049f')" width="340px" height="238px"/>
Here i'm trying to load some external image using blobkey. But its not working.
sample-3
<fo:external-graphic src="220.226.207.170/mcraftuat/storageservice?a=readfile&databasename=mco&blobkey=f251fcf9-afa1-49cb-9a48-093cc0af049f" width="340px" height="238px"/>
Above code also not working.
Please guide or suggest better option or method to load image available on third party site.
Please note that, I'm trying to load this and generating PDF using XSL & XML.
Any more info needed please comment accordingly. Thank you!

Get image from webpage via javascript to display

I have an application that loads an image - the URL of the image however is dynamically generated.
The image URL would look like this (I get the image name through their API):
http://openweathermap.org/img/w/10d.png
That URL is created in javascript - how would I make javascript actually get the image from that URL and return the .png so I could display it?
Would ajax be best for this? The solution would have be in regular javascript as the application displaying the image only allows for basic javascript.
Edit: This is for a digital signage solution - so I need to get the .png file into javascript where I will return ThePicture so the signage can display it appropriately. So unfortunately, just adding it to the/a DOM won't work.

How to grab and display img from external site

I'm trying to figure out how to grab the image from an external site, in my case, http://bikerace.com/tracks/[levelCode]
(as an example level code, nhx874, the url would be http://www.bikerace.com/tracks/nhx874)
Users on bikeracelevels(dot com) have to input the level code THEN upload a screenshot. I'm trying to remove this requirement by automatically grabbing the image based on the code they input, since I could append their input code to the url, then somehow find the image (since the only image on the page would be the one I want)
How could I accomplish this?
Thank you very much in advance!
Get this cross-domain AJAX plugin for use with jQuery: https://github.com/padolsey/jquery.fn/tree/master/cross-domain-ajax
Use it to load the page on bikerace.com/[levelcode], then select the image from the data as you normally would with jQuery.

Share simple content on Facebook time line

I want to share some simple text content on facebook time line using javascript of html. I have tried the below but i am unable to add any content, Can anyone help me how to create the below url to share content dynamically. What is the key for sharing content.
facebookshare
Thanks
djrecker
Try to encode the url shared, i.e. if you are using PHP try to call
p[url]=urlencode(LINK)
Same to the title and summary

How to convert Html to image in asp.net

I want to convert my page into image, I have try html2canvas for convert HTML to image but is is not working for me because in my HTML some image load from other domain and cross domain image not load in canvas.
Thanks in advance.
I have used this one for a similar task and it works fine.
In my case i used this to convert HTML to image. You can try it out. It is available for FREE.
Hope it works...

Categories

Resources