Generate Previews from External Links

Code e-Shop
2 min readJul 4, 2021

Well as there are tons of websites in the cloud space and to maintain every website is a work itself for the owner but sometimes what we need is to get some previews from other websites on certain links ( like it does in facebook platform ) and that links are from different websites

whereas most of the websites these days are using Captcha and other sort of mediums to block the access or scraping of data yet they provide a viable solution as per implemented below for increasing the number of previews that we can generate from different urls. Let’s look at it for now…

  1. Create the curl request method.

Here we distinguish the referrer as somewhat the urls which would not be blocked by other websites as to generate previews so we have used facebook.

2. Create a Helper function so as to convert the unwanted to a more readable form so you can made changes as per required in here or can remove it to show the same characters.

3. Now the main part where we assemble all other functions to work in a harmonious way.

4. Saving the data in SQL Database

5. Returning the formatted data as per the requirements

By following the above steps it would become quite simple to get a preview from a website that may be creating issue in getting them. If you have any queries or issue feel free to ask us.

--

--

Code e-Shop

Code e-Shop is Add-on for your need and helps enterprises to grow easily with a large range of ready to use and highly customisable eCommerce products.