PageSourceSearch

https://httparchive.org/_astro/index.astro_astro_type_script_index_0_lang.CnSg9oh1.js

js httparchive.org collected 2026-09-24 06:53:17 UTC 4,518 bytes, 1 lines download raw bytes

1var e=class{renderPosts(e,n){let r=document.createDocumentFragment();return fetch(`https://dev.to/api/articles?username=httparchive`).then(e=>e.json()).then(i=>{i.sort((e,n)=>t.getPublishDate(n)-t.getPublishDate(e)).filter((e,t)=>t<3).forEach(e=>{let i=new t(e,n);r.appendChild(i.render())}),e.appendChild(r)})}},t=class{static getPublishDate(e){return new Date(e.published_at)}constructor(e,t){this.post=e,this.template=t.content.cloneNode(!0)}render(){return this.renderTitle(),this.renderByline(),this.renderTags(),this.renderAuthorAvatar(),this.renderReactions(),this.template}renderTitle(){let e=this.template.querySelector(`.blog-post-title`);e.href=this.post.url,e.innerText=this.post.title}renderByline(){let e=this.template.querySelector(`.blog-post-byline`),t=e.querySelector(`.blog-post-author`);t.href=this.getAuthorURL(),t.innerText=this.post.user.name;let n=e.querySelector(`.blog-post-publication-date`);n.innerText=this.post.readable_publish_date}renderAuthorAvatar(){let e=this.template.querySelector(`.blog-post-author-avatar`);e.href=this.getAuthorURL();let t=e.querySelector(`img`);t.src=this.post.user.profile_image_90,t.title=this.post.user.name,t.alt=this.post.user.name}renderTags(){let e=this.template.querySelector(`.blog-post-tags`),t=e.querySelector(`a`);this.post.tag_list.forEach(n=>{let r=t.cloneNode(!0);r.href=this.getTagURL(n),r.innerText=`#${n}`,e.appendChild(r)}),t.remove()}renderReactions(){let e=this.template.querySelector(`.blog-post-reactions`),t=e.querySelector(`.blog-post-likes`);t.href=this.post.url;let n=t.querySelector(`span`);n.innerText=this.post.positive_reactions_count;let r=e.querySelector(`.blog-post-comments`);r.href=`${this.post.url}#comments`;let i=r.querySelector(`span`);i.innerText=this.post.comments_count}getAuthorURL(){return`https://dev.to/${this.post.user.username}`}getTagURL(e){return`https://dev.to/t/${e}`}},n=`https://discuss.httparchive.org`,r=2,i=class{static get ORIGIN(){return n}constructor(e,t,n,r){this.title=e,this.slug=t,this.replies=n,this.users=r}toNode(){let e=document.createElement(`tr`);return e.classList.add(`discussion`),e.appendChild(this.getTopicNode()),e.appendChild(this.getRepliesNode()),e}getTopicNode(){let e=document.createElement(`td`);return e.appendChild(this.getUsersNode()),e.appendChild(this.getTitleNode()),e}getRepliesNode(){let e=document.createElement(`td`),t=document.createElement(`span`);return t.classList.add(`discussion-replies`),t.innerText=this.replies,e.appendChild(t),e}getUsersNode(){let e=document.createElement(`ul`);if(e.classList.add(`discussion-users`),e.classList.add(`hidden-xs`),this.users.slice(0,r).map(e=>{let t=document.createElement(`li`),n=document.createElement(`a`);n.href=this.getUserProfileUrl(e);let r=document.createElement(`img`);return r.classList.add(`discussion-user`),r.src=this.getUserImgUrl(e),r.alt=e.username,r.title=e.username,r.width=`32`,r.height=`32`,r.loading=`lazy`,n.appendChild(r),t.appendChild(n),t}).forEach(t=>e.appendChild(t)),this.users.length>r){let t=document.createElement(`li`),n=document.createElement(`span`),i=this.users.length-r;n.classList.add(`discussion-users-remaining`),n.innerText=i,n.title=`${i} more user${i===1?``:`s`}`,t.appendChild(n),e.appendChild(t)}return e}getTitleNode(){let e=document.createElement(`div`);e.classList.add(`discussion-title`);let t=document.createElement(`a`);return t.href=`${n}/t/${this.slug}`,t.innerText=this.title,e.appendChild(t),e}getUserImgUrl(e){let t=e.avatar_template.replace(`{size}`,50);return t[0]===`/`?n+t:t}getUserProfileUrl(e){return`${n}/u/${e.username}/`}},a=document.getElementById(`discuss`),o=document.getElementById(`discussions`);function s(){let t=document.getElementById(`blog`),n=document.getElementById(`blog-posts`),r=document.getElementById(`blog-post-template`);if(!t||!n){console.error(`no blog sections`,t,n);return}new e().renderPosts(n,r).then(()=>t.classList.remove(`hidden`))}function c(){if(!a||!o)return;let e=new Set;fetch(`${i.ORIGIN}/latest.json`).then(e=>e.json()).then(t=>{let n=t.topic_list.topics.slice(0,2);n.forEach(t=>e.add(t.id)),l(n,t.users)}).then(()=>fetch(`${i.ORIGIN}/top.json`)).then(e=>e.json()).then(t=>{l(t.topic_list.topics.filter(t=>!e.has(t.id)).slice(0,3),t.users)}).then(()=>a.classList.remove(`hidden`))}function l(e,t){let n=new Map(t.map(e=>[e.id,e]));
1e&&e.length&&n.size&&e.forEach(e=>{let t=e.title,r=e.slug,i=e.posts_count;u(t,r,i,e.posters.map(e=>n.get(e.user_id)))})}function u(e,t,n,r){let a=new i(e,t,n,r);o.appendChild(a.toNode())}s(),c();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.