JSPM

sourceapi

0.0.4
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 2
    • Score
      100M100P100Q22087F
    • License MIT

    Source Code API for https://sourcecode.glitch.me

    Package Exports

    • sourceapi

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sourceapi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Source Code API

    NOTE: This is an alpha build while the API gets reworked, supports ID's & all

    Website: https://sourcecode.glitch.me

    Note:

    • <data>.packagesUsed are actually tags
    • <data>.views aren't counted
    • <data>.rating may return an array

    Example:

    let sc = require('sourceapi');
    
    sc('1363896474854890').then(i => {
      
      console.log(i);
      /* ->
      
      { username: '[HypeSquad] ricegrains#0911',
      title: 'Weather command',
      difficulty: 'Easy/Medium',
      packagesUsed: 'weather-js, discord.js',
      code: 'const Discord = require(\'discord.js\');\nconst weather = require(\'weather-js\');\n\nmodule.exports.run = (client, message, args) => {\n  weather.find({search: args.join(" "), degreeType: \'C\'}, function(err, result) {\n      if (err) message.channel.send(err);\n      if (result === undefined || result.length === 0) {\n          message.channel.send(\'**Please enter a location!**\')\n          return;\n      }\n      var current = result[0].current;\n      var location = result[0].location;\n      const embed = new Discord.RichEmbed()\n          .setDescription(`**${current.skytext}**`)\n          .setAuthor(`Weather for ${current.observationpoint}`)\n          .setThumbnail(current.imageUrl)\n          .setColor(0x00AE86)\n          .addField(\'Timezone\',`UTC${location.timezone}`, true)\n          .addField(\'Degree Type\',location.degreetype, true)\n          .addField(\'Temperature\',`${current.temperature} Degrees`, true)\n          .addField(\'Feels Like\', `${current.feelslike} Degrees`, true)\n          .addField(\'Winds\',current.winddisplay, true)\n          .addField(\'Humidity\', `${current.humidity}%`, true)\n          message.channel.send({embed});\n  })\n}',
      desc: '',
      key: '1363896474854890',
      approved: true,
      views: 0,
      rating: 0 }
      
      */
      
    });