This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import Spinner from "./Spinner"; | |
import axios from "axios"; | |
export default function SignIn() { | |
const [loading, setLoading] = useState(false); | |
const startAuth = () => { | |
setLoading(true); | |
axios | |
.get("/start-auth") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from "react"; | |
import Spinner from "./Spinner"; | |
import axios from "axios"; | |
import qs from "query-string"; | |
export default function SignIn(props) { | |
useEffect(() => { | |
// gets the returned query | |
const query = qs.parse(props.location.search, { ignoreQueryPrefix: true }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
export default function Home(props) { | |
const [user, setUser] = useState({}); | |
useEffect(() => { | |
// if Home page is loaded directly | |
if (!props.location.state) { | |
alert("an error occured"); | |
props.history.push("/"); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; | |
import "./App.css"; | |
import SignIn from "./components/SignIn"; | |
import AuthPage from "./components/AuthPage"; | |
import Home from "./components/Home"; | |
function App() { | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() | |
const express = require('express'); | |
const cors = require('cors') | |
const app = express(); | |
const oauth = require('oauth') | |
const consumer = new oauth.OAuth( | |
"https://twitter.com/oauth/request_token", "https://twitter.com/oauth/access_token", | |
process.env.consumerKey, process.env.consumerSecret, "1.0A", "http://127.0.0.1:3000/auth-page", "HMAC-SHA1"); | |
app.use(cors()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import Images from "./components/Images"; | |
import Spinner from "./components/Spinner"; | |
import axios from "axios"; | |
import "./App.css"; | |
function App() { | |
// stats | |
const [inputValue, onInputChange] = useState(""); | |
const [images, setImages] = useState([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default props => | |
props.images.map((image, i) => ( | |
<div key={i} className="fadein"> | |
<div onClick={() => props.removeImage(image)} className="delete"> | |
<i className="fas fa-times-circle" /> | |
</div> | |
<img | |
src={image.fileSrc} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import spinner from '../assets/img/spinner.gif'; | |
export default () => { | |
return ( | |
<div> | |
<img | |
src={spinner} | |
style={{ width: '200px', margin: 'auto', display: 'block' }} | |
alt="Loading..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import spinner from '../assets/img/spinner.gif'; | |
export default () => { | |
return ( | |
<div> | |
<img | |
src={spinner} | |
style={{ width: '200px', margin: 'auto', display: 'block' }} | |
alt="Loading..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config(); | |
const express = require("express"); | |
const cors = require("cors"); | |
const app = express(); | |
const formData = require("express-form-data"); | |
var Twitter = require("twitter"); | |
var async = require("async"); | |
const fs = require("fs"); | |
app.use(cors()); |
OlderNewer