Website logo

Post Reply
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Website logo

Post by Natter »

Hi,

Is it possible to get logos of certain websites ?
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Website logo

Post 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

#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
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Website logo

Post 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
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Website logo

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Website logo

Post 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

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

XImage( mfoto )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Website logo

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Otto
Posts: 6380
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Website logo

Post 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.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Website logo

Post by nageswaragunupudi »

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
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Website logo

Post by cmsoft »

nageswaragunupudi wrote: we can use

Code: Select all | Expand

XImage( mfoto )
Muchas gracias Mr. Rao...
Post Reply