Website logo

Website logo

Postby Natter » Wed May 17, 2023 12:07 pm

Hi,

Is it possible to get logos of certain websites ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Website logo

Postby cmsoft » Wed May 17, 2023 4: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: Select all  Expand view  RUN

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

Re: Website logo

Postby Natter » Thu May 18, 2023 7: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/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
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Website logo

Postby Otto » 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Website logo

Postby nageswaragunupudi » 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: Select all  Expand view  RUN
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  RUN
XImage( mfoto )
Regards

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

Re: Website logo

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Website logo

Postby Otto » 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/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
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Website logo

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Website logo

Postby cmsoft » Thu May 18, 2023 12:14 pm

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

Muchas gracias Mr. Rao...
User avatar
cmsoft
 
Posts: 1292
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 25 guests