Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukr committed Sep 22, 2015
1 parent 2761022 commit 33170b7
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Created by https://www.gitignore.io/api/osx,node

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
config.js

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# mtg-crawler
--------------

npm install
npm start
6 changes: 6 additions & 0 deletions config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
credentials: {
accessKeyId: 'id',
secretAccessKey: 'secret'
}
}
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import AWS from 'aws-sdk'
import http from 'http'
import config from './config.js'

AWS.config.update(config.credentials)

let s3 = new AWS.S3()

http.get('http://magiccards.info/scans/en/al/232.jpg', res => {
s3.upload({
Bucket: 'nukr-images',
Key: 'mtg/black_lotus.jpg',
ContentType: 'jpg',
Body: res
}, (err, data) => {
console.log(err, data)
})
})
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "mtg-crawler",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "babel-node --stage 0 index",
"dev": "nodemon --exec 'babel-node --stage 0 index'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nukr/mtg-crawler.git"
},
"author": "nukr",
"license": "MIT",
"bugs": {
"url": "https://github.com/nukr/mtg-crawler/issues"
},
"homepage": "https://github.com/nukr/mtg-crawler#readme",
"dependencies": {
"aws-sdk": "^2.2.4"
},
"devDependencies": {
"nodemon": "^1.7.0"
}
}

0 comments on commit 33170b7

Please sign in to comment.