Git Product home page Git Product logo

docpad-plugin-tumblr's People

Contributors

balupton avatar vsopvsop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docpad-plugin-tumblr's Issues

Brainstorm

Few ways we can go about this.


Via a node module pipe like solution and a docpad configuration file:

# Prepare
tumblrImporter = new (require('docpad-importer-tumblr'))({
    blog: 'balupton.tumblr.com'
    apiKey: 'asd'
    docpad: docpad
})

# DocPad Config
module.exports =
    events:
        parseAfter: tumblrImporter.load

Via or via a docpad plugin and a docpad configuration file:

# DocPad Config
module.exports =
    plugins:
        tumblr:
            blog: 'balupton.tumblr.com'
            apiKey: 'asd'

Tests fail with a number or errors and warnings

Hi, I started working on a MongoDB plugin based off of this one, and I kept getting strange test failures, so it occurred to me to run the tests on this plugin, and sure enough, they're failing too:

$ cake test
cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test

> [email protected] test c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master
> node ./out/tumblr.test.js

tumblr-master
tumblr-master > create
warning: The plugin tumblr-master uses an invalid naming convention. We only allow alphanumeric characters (no symbols). Perhaps change it t
o tumblrmaster
For more information about what this means, visit:
    http://docpad.org/plugin-conventions
warning: The plugin tumblr-master is using a different name (tumblr) for its prototype name. This can cause issues.
For more information about what this means, visit:
    http://docpad.org/plugin-conventions
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
  at c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\out\lib\docpad.js:4107:17
  at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
tumblr-master > create OK
tumblr-master > load plugin tumblr-master
tumblr-master > load plugin tumblr-master OK
tumblr-master > generate
tumblr-master > generate > action
error: An error occured:
Error: Tumblr plugin is not configured correctly
  at TumblrPlugin.fetchTumblrData (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\out\tumblr.plugin.js:59:17)
  at TumblrPlugin.populateCollections (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\out\tumblr.plugin.js:165:14)
  at ambi (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:55:18)
  at Task.<anonymous> (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\event-emitter-grouped\out\l
ib\event-emitter-grouped.js:45:23)
  at ambi (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:55:18)
  at fire (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:384:27)
  at b (domain.js:183:18)
  at Domain.run (domain.js:123:23)
  at Task.fire (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:398
:25)
  at Object._onImmediate (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgr
oup.js:414:26)
  at processImmediate [as _immediateCallback] (timers.js:345:15)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
tumblr-master > generate > action ERR!
tumblr-master > generate ERR!
tumblr-master ERR!

FAILURE: 2/3 tests ran successfully; 1 failed, 0 incomplete, 1 errors

Error #1:
tumblr-master > generate > action
Error: Tumblr plugin is not configured correctly
  at TumblrPlugin.fetchTumblrData (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\out\tumblr.plugin.js:59:17)
  at TumblrPlugin.populateCollections (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\out\tumblr.plugin.js:165:14)
  at ambi (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:55:18)
  at Task.<anonymous> (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\event-emitter-grouped\out\l
ib\event-emitter-grouped.js:45:23)
  at ambi (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\ambi\out\lib\ambi.js:55:18)
  at fire (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:384:27)
  at b (domain.js:183:18)
  at Domain.run (domain.js:123:23)
  at Task.fire (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgroup.js:398
:25)
  at Object._onImmediate (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\node_modules\docpad\node_modules\taskgroup\out\lib\taskgr
oup.js:414:26)
  at processImmediate [as _immediateCallback] (timers.js:345:15)


npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\Cakefile:99
      throw err;
            ^
Error: Process exited with error status code
  at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\Downloads\docpad-plugin-tumblr-master\Cakefile:88:15)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:756:16)
  at Process.ChildProcess._handle.onexit (child_process.js:823:5)

In my case, I'm getting a somewhat different set of errors (http://stackoverflow.com/questions/26391988/docpad-plugin-odd-errors-when-testing-hangs-when-including-in-project) but it does still have the Error: Didn't place the skeleton as the desired structure already exists one - any idea what's going on here?

Bug: Incompatible with docpad run command

When using docpad run, trying to access the generated document raise an error

TypeError: Cannot read property 'size' of null 
at DocPad.serveDocument (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:4099:52) 
at DocPad.serveDocument (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:5:61) 
at /Volumes/Externe/tmp/docpad/out/lib/docpad.js:4149:23 
at DocPad.getFileByRoute (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:593:7) 
at DocPad.serverMiddlewareRouter (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:4139:14) 
at Object.handle (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:5:61) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at pass (/Volumes/Externe/tmp/docpad/node_modules/express/lib/router/index.js:110:24) 
at Router._dispatch (/Volumes/Externe/tmp/docpad/node_modules/express/lib/router/index.js:173:5) 
at Object.router (/Volumes/Externe/tmp/docpad/node_modules/express/lib/router/index.js:33:10) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at DocPad.serverMiddlewareHeader (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:4132:7) 
at Object.handle (/Volumes/Externe/tmp/docpad/out/lib/docpad.js:5:61) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Object.methodOverride [as handle] (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:48:5) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Object.json [as handle] (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/middleware/json.js:42:37) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Object.urlencoded [as handle] (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:41:37) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Object.expressInit [as handle] (/Volumes/Externe/tmp/docpad/node_modules/express/lib/middleware.js:30:5) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Object.query [as handle] (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/middleware/query.js:45:5) 
at next (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:193:15) 
at Function.app.handle (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/proto.js:201:3) 
at [object Object].app (/Volumes/Externe/tmp/docpad/node_modules/express/node_modules/connect/lib/connect.js:65:37) 
at [object Object].EventEmitter.emit (events.js:98:17) 
at [object Object].request (/Volumes/Externe/tmp/gssb-menu-site/node_modules/docpad-plugin-livereload/node_modules/primus/transformer.js:135:36) 
at Server.EventEmitter.emit (events.js:98:17) 
at HTTPParser.parser.onIncoming (http.js:2108:12) 
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23) 
at Socket.socket.ondata (http.js:1966:22) 
at TCP.onread (net.js:525:27)

DocPad.serveDocument code in question is

# ETag: `"<size>-<mtime>"`
ctime = document.get('date')    # use the date or mtime, it should always exist
mtime = document.get('wtime')   # use the last generate time, it may not exist though
stat = document.getStat()
res.setHeaderIfMissing('ETag', '"' + stat.size + '-' + Number(mtime) + '"')  if mtime

the generated document for each tumblr post is "virtual" (fullPath is null). As a result, there is no stat on the document.

  • Why not using mtime instead of wtime for ETag ?
  • What is the best approch to solve this bug ?
  • I can make a PR.

Thanks.

Retrieving posts from a private blog failed

I have a private Tumlr blog and retrieving posts from a private blog is not possible. I think, the oAuth Header is missing in the feedr get request.

feedr.readFeed tumblrUrl, {parse:'json'}

Maybe it should be possible to inject request options in the feedr from plugin configuration like

feedr.readFeed(tumblrUrl, {
requestOptions: {
oauth: {
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
token: config.token,
token_secret: config.token_secret
}
},
parse: 'json'
}, function(err, feedData) {
...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.