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

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
YuheiNakasaka committed Apr 2, 2017
1 parent 7f0de0c commit 487eb57
Show file tree
Hide file tree
Showing 11 changed files with 2,718 additions and 25 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
# vue-twitter-client-app

> An electron-vue project
# vue-twitter-client

Twitter client created with Vue.js + Electron

<img src="https://i.gyazo.com/efa829295518aa44e73e277ce3e7ecf9.png">

# Feature

- display hometime line
- display image, animated gif and video
- display lists
- display mentions
- show profile
- show some notifications
- search tweet
- tweet text
- tweet text with images
- retweet
- favorite
- reply
- follow/unfollow
- open media with link clicked
- streaming timeline(home, search)
- real time update with pooling(list, mention)

# Development

## Build Setup

Expand Down
Binary file added app/dist/fonts/fontawesome-webfont.eot
Binary file not shown.
Binary file added app/dist/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added app/dist/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added app/dist/fonts/fontawesome-webfont.woff2
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions app/dist/imgs/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Simple twitter client created with electron-vue",
"main": "./dist/main.js",
"dependencies": {
"axios": "^0.15.3",
"babel-runtime": "^6.23.0",
"dotenv": "^4.0.0",
"font-awesome": "^4.7.0",
"moment": "^2.18.1",
Expand Down
27 changes: 12 additions & 15 deletions app/src/main/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,43 @@ import { app, BrowserWindow } from 'electron'
import AuthenticationWindow from './authentication-window'
import Store from '../renderer/libraries/store'

let winURL = process.env.NODE_ENV === 'development'
? `http://localhost:${require('../../../config').port}`
: `file://${__dirname}/index.html`

let store = new Store({ configName: 'user-preferences', defaults: {} })

export default class Application {
constructor () {
this.store = new Store({ configName: 'user-preferences', defaults: {} })
this.winURL = process.env.NODE_ENV === 'development'
? `http://localhost:${require('../../../config').port}`
: `file://${__dirname}/index.html`
this.accessToken = null
this.accessTokenSecret = null
this.consumerKey = process.env.TWITTER_CONSUMER_KEY
this.consumerSecret = process.env.TWITTER_CONSUMER_SECRET
this.mainWindow = undefined
}

createWindow () {
this.mainWindow = new BrowserWindow({
height: 800,
width: 1200
height: 600,
width: 570
})

this.mainWindow.loadURL(winURL)
this.mainWindow.loadURL(this.winURL)

this.mainWindow.on('closed', () => {
this.mainWindow = null
})
}

openAuthenticationWindow () {
let defaultUser = store.get('defaultUser')
let that = this
let defaultUser = this.store.get('defaultUser')
if (defaultUser && defaultUser.accessToken && defaultUser.accessTokenSecret && defaultUser.consumerKey && defaultUser.consumerSecret) {
this.createWindow()
} else {
new AuthenticationWindow().on('authentication-succeeded', (res) => {
store.set('defaultUser', {
this.store.set('defaultUser', {
user: res.user,
accessToken: res.accessToken,
accessTokenSecret: res.accessTokenSecret,
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET
consumerKey: res.consumerKey,
consumerSecret: res.consumerSecret
})
this.createWindow()
})
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/authentication-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import Twitter from 'node-twitter-api'
export default class AuthenticationWindow extends EventEmitter {
constructor (callback) {
super()
this.consumerKey = '7sVNvnON2PTKLcQcCbmNhLvFG'
this.consumerSecret = '9Qq7ZbpHN0SxY7ErEnBgfYviJkWszN8YOFZb0uytTuUBii4aAd'

const twitter = new Twitter({
callback: 'http://example.com',
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET
consumerKey: this.consumerKey,
consumerSecret: this.consumerSecret
})

twitter.getRequestToken((error, requestToken, requestTokenSecret) => {
Expand All @@ -31,6 +34,8 @@ export default class AuthenticationWindow extends EventEmitter {
that.emit(
'authentication-succeeded',
{
consumerKey: that.consumerKey,
consumerSecret: that.consumerSecret,
accessToken: accessToken,
accessTokenSecret: accessTokenSecret,
user: data
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
'use strict'

require('dotenv').config({ path: __dirname + '/.env' })

import Application from './application'

global.application = new Application()
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/components/TweetbarView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="media">
<input type="file" v-on:change="selectImage" accept="image/jpg,image/png" multiple/>
<i class="fa fa-picture-o" aria-hidden="true"></i>
<span>add image</span>
<span>add images</span>
</div>
</div>
</div>
Expand Down

0 comments on commit 487eb57

Please sign in to comment.