awwwards
Version:
awwwards API
1 lines • 2.96 kB
JavaScript
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.w={},r(r.s=3)}([function(e,t){e.exports=require("cheerio")},function(e,t){e.exports=require("axios")},function(e,t){e.exports=require("querystring")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=l(r(2)),u=l(r(1)),i=l(r(0));function l(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);return u.default.get("https://awwwards.com/websites?"+o.default.stringify(t)).then(function(e){var t=[];return(0,i.default)(".box-item",e.data).each(function(e,r){t.push({image:(0,i.default)("img[data-srcset]",r).attr("data-srcset").split(", ").pop().split(" ").shift(),site:"https://awwwards.com"+(0,i.default)("figure a",r).attr("href"),link:(0,i.default)('a[target="_blank"]',r).attr("href"),title:(0,i.default)("h3",r).text(),author:{name:(0,i.default)("strong a",r).first().text(),url:"https://awwwards.com"+(0,i.default)("strong a",r).first().attr("href"),country:(0,i.default)(".content > .row:nth-child(2)",r).text().trim().replace(/\s\s+/g," ").split(" from ").pop()},date:(0,i.default)(".content > .row",r).last().text().trim().replace(/\s\s+/g," ").split(" in ").shift(),category:(0,i.default)(".content > .row",r).last().text().trim().replace(/\s\s+/g," ").split(" in ").pop()})}),t})}return a(e,null,[{key:"sites_of_the_day",value:function(t){return new e(n({},t,{award:"sites_of_the_day"}))}},{key:"sites_of_the_month",value:function(t){return new e(n({},t,{award:"sites_of_the_month"}))}},{key:"sites_of_the_year",value:function(t){return new e(n({},t,{award:"sites_of_the_year"}))}},{key:"developer",value:function(t){return new e(n({},t,{award:"developer"}))}},{key:"mobile_excellence",value:function(t){return new e(n({},t,{award:"mobile_excellence"}))}},{key:"honorable_mentions",value:function(t){return new e(n({},t,{award:"honorable"}))}},{key:"nominees",value:function(t){return new e(n({},t,{award:"nominees"}))}}]),e}();t.default=s}]).default;