GitHub Profile Card

Create and share your Github profile Card

Code


// Bruzu API key get yours at https://bruzu.com
$apiKey = "BRUZU-YOURKEY";

// How to get this token:- https://github.com/settings/tokens/new 
// No need to select any scope 
$token = ""; 

// Github username
$id="motyar";

$url = "https://api.github.com/users/".$id;

$context = stream_context_create(array(
    'http' => array(
        'header'  => "Authorization: token ".$token."\n"."User-Agent: PHP"
    )
));
$data = json_decode(file_get_contents($url, false, $context), true);


$template = 'https://img.bruzu.com/?bg=%23f0f3ff&h=500&w=500&a.tp=image&a.ox=center&a.oy=center&a.x=250&a.y=126&a.w=460&a.h=460&a.sx=0.4&a.sy=0.4&a.src=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F517371%3Fv%3D4&a.circleFrame=true&b.tp=textbox&b.ox=center&b.oy=center&b.x=250&b.y=273&b.w=416&b.h=57&b.t=&b.ta=center&b.fs=50&b.lh=1&b.fw=700&b.ff=Montserrat&b.fontStyle=normal&b.maxHeight=50&c.tp=textbox&c.ox=center&c.oy=center&c.x=250&c.y=317&c.w=416&c.h=23&c.fill=%23555&c.t=&c.ta=center&c.fs=20&c.lh=1&c.fw=400&c.ff=Inter&c.fontStyle=normal&c.maxHeight=20&d.tp=textbox&d.oy=center&d.x=42&d.y=411&d.w=83&d.h=68&d.fill=%23555&d.t=&d.ta=center&d.fs=60&d.lh=1&d.fw=900&d.ff=Inter&d.fontStyle=normal&d.ox=left&d.maxHeight=60&e.tp=textbox&e.ox=center&e.oy=center&e.x=250&e.y=410&e.w=83&e.h=68&e.fill=%23555&e.t=&e.ta=center&e.fs=60&e.lh=1&e.fw=900&e.ff=Inter&e.fontStyle=normal&e.maxHeight=60&f.tp=textbox&f.ox=right&f.oy=center&f.x=459&f.y=411&f.w=83&f.h=68&f.fill=%23555&f.t=&f.ta=center&f.fs=60&f.lh=1&f.fw=900&f.ff=Inter&f.fontStyle=normal&f.maxHeight=60&g.tp=textbox&g.ox=center&g.oy=center&g.x=83&g.y=452&g.w=127&g.h=23&g.t=Followers&g.ta=center&g.fs=20&g.lh=1&g.fw=400&g.ff=Inter&g.fontStyle=normal&g.maxHeight=500&h.tp=textbox&h.ox=center&h.oy=center&h.x=417&h.y=453&h.w=127&h.h=23&h.t=Repositories&h.ta=center&h.fs=20&h.lh=1&h.fw=400&h.ff=Inter&h.fontStyle=normal&h.maxHeight=500&i.tp=textbox&i.ox=center&i.oy=center&i.x=250&i.y=454&i.w=127&i.h=23&i.t=Following&i.ta=center&i.fs=20&i.lh=1&i.fw=400&i.ff=Inter&i.fontStyle=normal&i.maxHeight=500&j.tp=image&j.ox=center&j.oy=center&j.x=456&j.y=53&j.w=496&j.h=512&j.sx=0.07&j.sy=0.07&j.src=https%3A%2F%2Fi.ibb.co%2Ffrv5pB3%2Fgithub-logo.png';


$q  = [
    "a.src"=> $data['avatar_url'],
    "b.t"=> $data['name'],
    "c.t"=>"@".$data['login'],
    "d.t"=>$data['followers'],
    "e.t"=>$data['following'],
    "f.t"=>$data['public_repos']
];

$imgLink = $template."&".http_build_query($q);

$png = file_get_contents($imgLink."&ak=".$apiKey);
$base64 = 'data:image/png;base64,' . base64_encode($png);

// You can use this link into your HTML code 
// <img src="<?=$imgLink?>" >
How to share github profile? You can share it by username of generate image of your profile to share more details into an image.
What profile picture should i use for github? Any picture that represents your personality is a good fit for all your social media including GitHub