Giter Site home page Giter Site logo

wechat_gallery's Introduction

Update

2016-3-11 The best way to crawl Pengyouquan Pictures is to use Droid4x+Anyproxy, get the pictures url and wget them together

Introduction

  • Export wiznote's note to be some printable content
    • The text content will be the first page
    • The images will be in the following pages

Check pdfservice for more options.

How to use it

  1. Put your content in wiznote in some specific directory, like 'We chat'.

  2. Find the we chat record like following and export them to csv file

select * from wiz_document where document_location="/We chat/";

The document_location can be various. copy the csv file to the location specified in server/config/index.js. or server/config/environment/development.js. For example, ./server/wechat/notes/wechat.csv

  1. Copy ~/.wiznote/your_account/data/notes to some where.
#!/bin/bash
# sample
cp -r ~/.wiznote/[email protected]/data/notes/* ./server/wechat/notes/
  1. Download the file from the front-end. (Because the jspdf need it, the nodejs wrapper doesnot work. You can improve it) Use following command to run the server at the root of the project
npm install && bower install && grunt

About insert Chinese

Use node-canvas, which is a Cairo backed Canvas implementation for NodeJS, to make picture from text.

Experience

I think nodejs is obviously not suitable for some download work. It really make the page slow and cannot accept new connections.

You cannot insert utf-8 character using jsPDF, though obviously it is much better than pdfmake.

Using custom font like Using Custom Font.

You need to get some ttf file from windows/fonts folder. Trust me, it is the fastest way to get ttf folder rather than download them from some where on the internet. It was completely a fault to search anything contains Chinese from the internet.

Then encode them into base64:

base64 -w 0 xxx.ttf > somefile.out

Then copy the file content into my_fonts.js under assets/fonts/

Problem I solved

  1. Using javascript to manipulate image is ... a bad solution... it is CPU sensitive

  2. Use node-canvas, PDF itself can embed fonts, but I need more time.

  3. Reduce memory usage, nodeJS it self has GC, but not investigate.

Problem unsolved

  1. NodeJS memory management, it must be a limitation, how to increase it and is it possible to make some cache?

  2. Is nodeJS not suitable for download-oriented site? I mean, can it accept connections when downloading?

  3. What is canvas

  4. Why dont you try ES6? and reduce the use of promise style programming. The return type change will significantly change your thinking style

wechat_gallery's People

Contributors

zycbobby avatar

Stargazers

Ansifa avatar

Watchers

James Cloos avatar  avatar

wechat_gallery's Issues

Make the project description more accurate.

  • It has nothing to do with wechat, remove the related description... (Just I use it for wechat)
  • It should complete show the wiznote 正文, it is more common

I a word, it is more likely to be a wiznote plugin.

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.