FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Website logo
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Website logo
Posted: Wed May 17, 2023 12:07 PM

Hi,

Is it possible to get logos of certain websites ?

Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Website logo
Posted: Wed May 17, 2023 04:19 PM
Yeah. It is possible and it depends on what you want to do, whether to just show it or download it.
To see:
Code (fw): Select all Collapse
#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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Website logo
Posted: Thu May 18, 2023 07:18 AM
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/allicons.json?url=www.stackoverflow.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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Website logo
Posted: Thu May 18, 2023 10:17 AM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Website logo
Posted: Thu May 18, 2023 10:21 AM
I agree I am not answering the main topic, but like to make a small point.
Instead of this code:
Code (fw): Select all Collapse
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 (fw): Select all Collapse
XImage( mfoto )
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Website logo
Posted: Thu May 18, 2023 10:23 AM
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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Website logo
Posted: Thu May 18, 2023 10:28 AM
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/stackoverflow/Img/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/stackexchange/Img/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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Website logo
Posted: Thu May 18, 2023 10:55 AM

Mr. Otto

Very nice

Thank you.

BTW, FWH still can not display SVG format.

Hope to provide this very soon.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: Website logo
Posted: Thu May 18, 2023 12:14 PM
nageswaragunupudi wrote: we can use
Code (fw): Select all Collapse
XImage( mfoto )
Muchas gracias Mr. Rao...

Continue the discussion