{"id":59,"date":"2017-11-16T15:12:22","date_gmt":"2017-11-16T15:12:22","guid":{"rendered":"https:\/\/html5-chat.com\/blog\/?p=59"},"modified":"2017-11-16T15:17:30","modified_gmt":"2017-11-16T15:17:30","slug":"how-to-auto-login-with-an-avatar","status":"publish","type":"post","link":"https:\/\/html5-chat.com\/blog\/how-to-auto-login-with-an-avatar\/","title":{"rendered":"How to auto login with an avatar ?"},"content":{"rendered":"<h3>How to autologin into HTML5-chat with an user avatar ?<\/h3>\n<p>ex: we want to login as <strong>John<\/strong>, whose <strong>sex<\/strong> is male an whose avatar is external url:\u00a0<strong>https:\/\/html5-chat.com\/img\/malecostume.svg<\/strong><\/p>\n<p>(let assume our script id is 1544 and token is\u00a05a0440c6c992c)<\/p>\n<div>&lt;script src=&#8217;https:\/\/html5-chat.com\/script\/1544\/5a0440c6c992c\/<strong>John<\/strong>\/<strong>couple<\/strong>\/<strong>aHR0cHM6Ly9odG1sNS1jaGF0LmNvbS9pbWcvbWFsZWNvc3R1bWUuc3Zn<\/strong>&#8216;&gt;&lt;\/script&gt;<\/div>\n<div><\/div>\n<div>This\u00a0<strong>aHR0cHM6Ly9odG1sNS1jaGF0LmNvbS9pbWcvbWFsZWNvc3R1bWUuc3Zn\u00a0<\/strong>represents the base64 url to our avatar:<\/div>\n<div><\/div>\n<div>in php we can use:\u00a0<a href=\"http:\/\/php.net\/manual\/fr\/function.base64-encode.php\"><span style=\"font-family: Consolas, Monaco, monospace;\">base64_encode<\/span><\/a><\/div>\n<div><\/div>\n<blockquote>\n<div>&lt;php $avatar = base64_encode(&#8216;https:\/\/html5-chat.com\/img\/malecostume.svg&#8217;); ?&gt;<\/div>\n<\/blockquote>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to autologin into HTML5-chat with an user avatar ? ex: we want to login as John, whose sex is male an whose avatar is external url:\u00a0https:\/\/html5-chat.com\/img\/malecostume.svg (let assume our script id is 1544 and token is\u00a05a0440c6c992c) &lt;script src=&#8217;https:\/\/html5-chat.com\/script\/1544\/5a0440c6c992c\/John\/couple\/aHR0cHM6Ly9odG1sNS1jaGF0LmNvbS9pbWcvbWFsZWNvc3R1bWUuc3Zn&#8216;&gt;&lt;\/script&gt; This\u00a0aHR0cHM6Ly9odG1sNS1jaGF0LmNvbS9pbWcvbWFsZWNvc3R1bWUuc3Zn\u00a0represents the base64 url to our avatar: in php we can use:\u00a0base64_encode &lt;php $avatar = base64_encode(&#8216;https:\/\/html5-chat.com\/img\/malecostume.svg&#8217;); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[9],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-news","tag-avatar"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":4,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/59\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}