Page 1 of 1

Website logo

PostPosted: Wed May 17, 2023 12:07 pm
by Natter
Hi,

Is it possible to get logos of certain websites ?

Re: Website logo

PostPosted: Wed May 17, 2023 4:19 pm
by cmsoft
Yeah. It is possible and it depends on what you want to do, whether to just show it or download it.
To see:
Code: Select all  Expand view

#include "fivewin.ch"
FUNCTION Main()
LOCAL oDlgR, oImg, mfoto
mfoto  := "https://bcnsoft.com.ar/wp-content/uploads/2020/08/Soluciones-Digitales-para-Pymes.png"

DEFINE DIALOG oDlgR FROM 10,10 TO 30,60
    @ 02,02 XIMAGE oImg SIZE 60,60 OF oDlgR FILE mfoto
ACTIVATE DIALOG oDlgR CENTER
RETURN nil

Re: Website logo

PostPosted: Thu May 18, 2023 7:18 am
by Natter
Thanks !

Links are often used in my program. I need to show them as icons. I also found a convenient way to get site logos

https://besticon-demo.herokuapp.com/all ... erflow.com

It will find all the logos for the website in multiple sizes and return a nice json string with metadata, including the URL of the icon. You just replace http://www.stackoverflow.com your domain. Access is done via WebView

Re: Website logo

PostPosted: Thu May 18, 2023 10:17 am
by Otto
Hello,

I wouldn't use an unknown website (https://besticon-demo.herokuapp.com) for this task.

You can retrieve the entire webpage using the onboard Fivewin function: cData := WebPageContents(cUrl)

Best regards,
Otto

Re: Website logo

PostPosted: Thu May 18, 2023 10:21 am
by nageswaragunupudi
I agree I am not answering the main topic, but like to make a small point.
Instead of this code:
Code: Select all  Expand view
DEFINE DIALOG oDlgR FROM 10,10 TO 30,60
    @ 02,02 XIMAGE oImg SIZE 60,60 OF oDlgR FILE mfoto
ACTIVATE DIALOG oDlgR CENTER

we can use
Code: Select all  Expand view
XImage( mfoto )

Re: Website logo

PostPosted: Thu May 18, 2023 10:23 am
by nageswaragunupudi
Otto wrote:Hello,

I wouldn't use an unknown website (https://besticon-demo.herokuapp.com) for this task.

You can retrieve the entire webpage using the onboard Fivewin function: cData := WebPageContents(cUrl)

Best regards,
Otto

After this, we need to parse the webpage code and extract the image-links. Possible, but we need to write the code for it now.

Re: Website logo

PostPosted: Thu May 18, 2023 10:28 am
by Otto
Btw, if you need it only once ask ChatGPT:

Certainly! Based on the HTML code provided, here is a list of the logos found:

Stack Overflow logo:

File path: https://cdn.sstatic.net/Sites/stackover ... g/logo.svg
Meta Stack Exchange logo:

File path: https://cdn.sstatic.net/Sites/meta/Img/logo.svg
Stack Exchange logo:

File path: https://cdn.sstatic.net/Sites/stackexch ... g/logo.svg
Please note that these are the logos explicitly mentioned as image URLs in the provided HTML code. There may be additional logos or images referenced elsewhere in the HTML or loaded dynamically from external sources.

Re: Website logo

PostPosted: Thu May 18, 2023 10:55 am
by nageswaragunupudi
Mr. Otto
Very nice
Thank you.
BTW, FWH still can not display SVG format.
Hope to provide this very soon.

Re: Website logo

PostPosted: Thu May 18, 2023 12:14 pm
by cmsoft
nageswaragunupudi wrote:we can use
Code: Select all  Expand view
XImage( mfoto )

Muchas gracias Mr. Rao...