Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NodeTalker/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.get('/gettweet/:word', (req, resGeneral) => {
let searchWord;
searchWord = req.params.word;
try {
const params = { q: searchWord + " since:2011-07-11", count: 3 };
const params = { q: searchWord + " since:2011-07-11", count: 10 };
const res = newTwit.get('/search/tweets', params, function (error, tweets, response) {
resGeneral.send(tweets);
});
Expand Down
3 changes: 2 additions & 1 deletion NodeTalker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ const newTwit = new Twit({
timeout_ms: 60 * 1000,
strictSSL: true
})

app.get('/gettweet/:word', (req: Request, resGeneral: Response) => {
let searchWord: any
searchWord = req.params.word
try {
const params = { q: searchWord + " since:2011-07-11", count: 3 }
const params = { q: searchWord + " since:2011-07-11", count: 10 }
const res = newTwit.get('/search/tweets', params, function (error: any, tweets: any, response: Response) {


Expand Down
20 changes: 11 additions & 9 deletions twittersearcher/src/Components/TweetList/TweetList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect } from 'react'
import Context from '../../GlobalState/Context'
import { Title, Text, Card, Container } from './TweetList_styles'
import { Title, Text, Card, Container, Welcome } from './TweetList_styles'

const TweetList = () => {
const { states, setters, requests } = useContext(Context)
Expand All @@ -11,12 +11,14 @@ const TweetList = () => {

}, [states.tweetListVar])







if (states.searchWord === null || states.searchWord === undefined || states.searchWord === "") {
return(
<Container>
<Welcome>Welcome! Please, insert a Word</Welcome>
</Container>
)
}
else {
return (
<Container>
{
Expand All @@ -34,9 +36,9 @@ const TweetList = () => {
}
</Container>
)




}
}

export default TweetList
13 changes: 13 additions & 0 deletions twittersearcher/src/Components/TweetList/TweetList_styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ display:flex;
flex-direction:column;
align-items: center;
justify-content:center;
`

export const Welcome = styled.div`
font-size: 12vh;
display:flex;
justify-content:center;
align-items: center;
background-color: #d3e0e3;
border-radius: 15%;
width: 80%;
height: 100%;
margin: 20vh 10vw;
padding: 5vh;
`
1 change: 1 addition & 0 deletions twittersearcher/src/Pages/MainPage/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const MainPage = () => {
<Button onClick={requests.searchTweet}>Search</Button>

</TopContainer>

<TweetList />
</>
)
Expand Down