140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
vanRijswijk says

Hello everybody,

I am currently working on an API system for a short url service, at this moment iam working on the QRcode section. Now heres my question:

If you look at bit.ly the have the following url for there qrcode.

http://bit.ly/#HASH_CODE#.qrcode

How do i filter .qrcode out of a url, i have searched many sites but could not find a solution.

Hope someone can help me with this. :)

296 posts
  • Sold between 10 000 and 50 000 dollars
  • Has been a member for 4-5 years
  • Exclusive Author
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • United States
CodeFusion says

Im not sure I understand you very well.

If you want to drop the qrcode
$original = "http://bit.ly/4nXvaN.qrcode";
echo '<a href="'.$original.'">'.$original.'</a><br />';

$new = str_replace(".qrcode","",$original);
echo '<a href="'.$new.'">'.$new.'</a><br />';

If you are wanting to get just the qrcode, it is not hidden in the url they give you. It is more likely in the database along side the original url. The ”.qrcode” attachment is most likely a trigger object.

I can imagine that they probably have a small script that reads the url, if .qrcode is present, then they return the qrcode instead of redirecting you to the original website.

Google offers a free qrcode service

http://code.google.com/apis/chart/docs/gallery/qr_codes.html

$your_link = "http://www.fremonttech.com";
echo '<a href="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8">QR Code</a><br />';
echo '<img src="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8" /><br />';
BTW , you can alter the size of the qrcode from bit.ly as well
http://bit.ly/4nXvaN.qrcode?s=800
140 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • Referred between 1 and 9 users
  • Bought between 100 and 499 items
  • Netherlands
vanRijswijk says

Thanks for the reply i am looking into it.

by
by
by
by
by
by