sourceapi

0.0.4 • Public • Published

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 }
  
  */
  
});

Readme

Keywords

Package Sidebar

Install

npm i sourceapi

Weekly Downloads

3

Version

0.0.4

License

MIT

Unpacked Size

26.5 kB

Total Files

7

Last publish

Collaborators

  • truexpixels