Using an "application only" token: https://dev.twitter.com/oauth/application-only
- Log in to @twitter_account twitter account
- Goto https://apps.twitter.com/
- Create a new app
- Get the consumer key and consumer secret
- Generate a bearer token with CURL:
| character | prefixcode | |
|---|---|---|
| 01 | ||
| t | 00 | |
| i | 110 | |
| s | 111 | |
| h | 1000 | |
| x | 1001 | |
| a | 1010 | |
| e | 1011 |
| " Begin .vimrc | |
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'VundleVim/Vundle.vim' |
| package main | |
| import ( | |
| "log" | |
| "github.com/aws/aws-lambda-go/events" | |
| "github.com/aws/aws-lambda-go/lambda" | |
| "github.com/aws/aws-sdk-go/service/ses" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "os" |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "logs:CreateLogGroup", | |
| "logs:CreateLogStream", | |
| "logs:PutLogEvents" | |
| ], |
Using an "application only" token: https://dev.twitter.com/oauth/application-only
| const fileSelector = document.getElementById('file-selector') | |
| fileSelector.addEventListener('change', (event) => { | |
| const file = event.target.files[0] | |
| const filereader = new FileReader() | |
| filereader.onloadend = function (evt) { | |
| if (evt.target.readyState === FileReader.DONE) { | |
| const uint = new Uint8Array(evt.target.result) | |
| let bytes = [] |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <title>Filereader</title> | |
| <style> | |
| div { | |
| font-family: "Helvetica Neue"; | |
| line-height:22px; | |
| font-size:15px; | |
| margin:10px 0; |
| class User { | |
| constructor(logger) { | |
| this.logger = logger | |
| } | |
| } | |
| const user = container.get('user') |
| const container = new Container() | |
| const config = { | |
| filename: 'app.log', | |
| rotate: true | |
| } | |
| container.register('config', config) | |
| container.singleton('logger', LoggerClass, ['config']) | |
| container.register('user', User, ['logger']) |
| app.post('/user/create', (req, res) => { | |
| const container = req.app.get('context') | |
| const logger = container.get('logger') | |
| }) |