ProfileBadge_Linkedin

Creates Linkedin profile badge for certain user as HTML output as string.
Updated 2024-03-12 to match latest structure

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ProfileBadge_Linkedin(Caption_Linkedin, UserFullURL_Linkedin, Or_UserLinkPart)
    ' You need to provide either Or_UserLinkPart or UserFullURL_Linkedin
    ' anmars or https://www.linkedin.com/in/anmars
    ' Preferrable Or_UserLinkPart
    ' UserFullURL_Linkedin Complete Linkedin URL
    ' example: https://www.linkedin.com/in/anmars
    ' Or_UserLinkPart The part of link after /in/ from your URL
    ' example: anmars from link above
    ' Caption_Linkedin Name to show in badge
    ' example: ANmar Amdeen
    '    Updated 2024-03-12
    ' <div class="badge-base LI-profile-badge" data-locale="en_US" data-size="large" data-theme="dark" data-type="HORIZONTAL" data-vanity="anmars" data-version="v1" > <a class="badge-base__link LI-simple-link" href="https://www.linkedin.com/in/anmars?trk=profile-badge" >ANmar Amdeen </a > </div >
    '
    '    Outdated as of 2024-03-11
    ' <div class="LI-profile-badge" data-version="v1" data-size="large" data-locale="en_US" data-type="horizontal" data-theme="dark" data-vanity="anmars" > <a class="LI-simple-link" href='https://www.linkedin.com/in/anmars?trk=profile-badge' >ANmar Amdeen </a > </div >
   
    Rett = ""
    ProfileBadge_Linkedin= Rett
   
    If Caption_Linkedin = "" Then Caption_Linkedin = "Linkedin user"
    If Or_UserLinkPart > "" Then UserFullURL_Linkedin = "https://www.linkedin.com/in/" & Or_UserLinkPart
    If UserFullURL_Linkedin = "" Then Exit Function
    Or_UserLinkPart        = CutString(UserFullURL_Linkedin, "/in/", "", 1)
   
    UserFullURL_Linkedin = UserFullURL_Linkedin & "?trk=profile-badge"
    Rett = " <div class=""badge-base LI-profile-badge"" data-version=""v1"" data-size=""Large"" "
    Rett = Rett & " data-locale=""en_US"" data-type=""HORIZONTAL"" data-theme=""dark"" "
    Rett = Rett & " data-vanity=""" & Or_UserLinkPart & """ > <a class=""badge-base__link LI-simple-link"" href='"
    Rett = Rett & UserFullURL_Linkedin
    Rett = Rett & "' >" & Caption_Linkedin & " </a > </div >"
    Rett = Rett & ""
    ProfileBadge_Linkedin= Rett
End Function


Caption_Linkedin, UserFullURL_Linkedin, Or_UserLinkPart

Response.Write ProfileBadge_Linkedin("", "ANmars", "ANmar Amdeen")

Views 2,071

Downloads 819

CodeID
DB ID