0

I had put a image on GitHub like this master/required_image/demo.png . I have generated a raw URL as https://raw.githubusercontent.com/<common_url>?token=GHSAT0AAAAAABRCB4PMH5JDBZHYBB5OBKO4YPY7CVQ

The problem with this is that it had token attached to it, which will be expired after 7 days as per official doc.

I want to use it on html page in production branch but since after 7 days it will be expired so could you please suggest some solution.

My repo is private as per client demand.

Any suggestion and solution welcomed. Thanks in advance

  • you intend to host a client on github? use https://pages.github.com/ then – GottZ Feb 01 '22 at 09:35
  • @GottZ not really, I am created a landing page for my client and I want to include client's company logo on landing page – Anubhav Srivastava Feb 01 '22 at 09:42
  • IIRC you can choose when the tokens expire on GitHub, at least the PAT – newbie Feb 01 '22 at 10:30
  • @newbie can you tell me how to use PAT( Personal access token ) any reference will be welcome – Anubhav Srivastava Feb 01 '22 at 10:38
  • @AnubhavSrivastava PAT is the token you generate when you want to pull into a remote Repository, it works as your password. But there you can set all kinds of parameters, so maybe I thought you could to the same with the token you use. What s the name of your token exactly? – newbie Feb 01 '22 at 10:43
  • @newbie can we connect somewhere if you are okay may be on LinkedIn linkedin.com/in/anubhav-kumar-srivastava-845360188 , I need some urgent help , thanks – Anubhav Srivastava Feb 01 '22 at 10:50
  • @AnubhavSrivastava not really, why is that? It is way more useful to discuss it here in the comments where, eventually, someone then finds a solution to a similar problem. When we discuss it privately no-one benefits from it – newbie Feb 01 '22 at 10:52
  • I will post the solution , for sure , but if still it is the issue then we can chat – Anubhav Srivastava Feb 01 '22 at 10:54
  • @newbie SO basically the problem is I am using this URL "https://raw.githubusercontent.com/AnubhaV1212/All-machine-learning-code/master/image/images.png?token=GHSAT0AAAAAABRCB4PMFGTGKPUH55NT5JXUYPZBZNA" in my html page but the auto generated token got expired after 7 days , now I know how to generate PAT but don't know how to use it to populate the image on html page – Anubhav Srivastava Feb 01 '22 at 10:56
  • I think you cant use the PAT for this issue. It was just a wild guess that maybe you can set the expiration date on your token, since you can do the same with the PAT. – newbie Feb 01 '22 at 10:59
  • @newbie I know that , but don't know how to use it in place of auto generated token, btw thanks – Anubhav Srivastava Feb 01 '22 at 11:03

1 Answers1

1

I found a alternative to this . Step 1). Open https://ezgif.com/ Step 2). Inside Image to Data URI converter, Convert photo to URI Step 3). Include tags for HTML image src Step 4). Now you will get a URI, use that in your html page code

Whooo! It's working

Thanks to Anukul for suggesting the solution