<commit_before>// Dependencies
var Config = require("../conf");

var Artworks = module.exports = {};

// TODO JSDoc
Artworks.fromArtist = function (user, callback) {

    var $ = null
      , $artworks = []
      , $cArtwork = null
      , artworks = []
      , i = 0
      ;

    function getSeq(page) {
        Request.get({
            url: "https://theartstack.com" + user.profile_url + "?page=" + page
          , headers: {
                "Cookie": Config.cookie
            }
        }, function (err, res, body) {
            if (err) { return callback(err); }
            $ = Cheerio.load(body);
            $artworks = $(".work-title [data-highres-pic]");
            if (!$artworks.length) {
                return callback(null, artworks);
            }
            for (i = 0; i < $artworks.length; ++i) {
                $cArtwork = $artworks.eq(i);
                artworks.push({
                    url: $cArtwork.attr("data-highres-pic")<commit_msg>Use util.request to make authenticated requests<commit_after>// Dependencies
var Config = require("../conf")
  , Util = require("../util")
  ;

var Artworks = module.exports = {};

// TODO JSDoc
Artworks.fromArtist = function (user, callback) {

    var $ = null
      , $artworks = []
      , $cArtwork = null
      , artworks = []
      , i = 0
      ;

    function getSeq(page) {
        Util.request(user.profile_url + "?page=" + page, function (err, $) {
            if (err) { return callback(err); }
            $artworks = $(".work-title [data-highres-pic]");
            if (!$artworks.length) {
                return callback(null, artworks);
            }
            for (i = 0; i < $artworks.length; ++i) {
                $cArtwork = $artworks.eq(i);
                artworks.push({
                    url: $cArtwork.attr("data-highres-pic")
{'fraction_non_alphanumeric': 0.15553121577217963, 'fraction_numerical': 0.002190580503833516, 'mean_word_length': 1.690721649484536, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '190647', 'n_tokens_mistral': 575, 'n_tokens_neox': 556, 'n_words': 119}