twitst4tz

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7c961b43d6b5c6964922d3b53e12f4eeaae12121
parent 514ebc6cbb563722b369c5814a5a28dcf0ab1667
Author: underd0g1 <hide4@comcast.net>
Date:   Sun, 26 Apr 2020 04:46:44 -0400

added sendit route

Diffstat:
Mindex.js | 15++++++++++++---
Mviews/index.ejs | 27++++++++++++++++++++++-----
Aviews/senditpage.ejs | 0
3 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/index.js b/index.js @@ -18,16 +18,25 @@ server.listen(3000, function(){ app.engine('html', require('ejs').renderFile); app.set('view engine', 'ejs'); -app.use(express.static(path.join(__dirname + '/Public'))); +app.use(express.static(path.join(__dirname + '/public'))); +app.use(bodyparser.urlencoded({ + extended: true +})); + // index routing app.get('/', function (req, res) { -res.sendFile(__dirname + '/views/index.html'); -console.log('got request made on / route!'); +console.log('got request made on / route! Sending the EJS page now!'); +res.render('index'); }); //optional array of terms to track //var watchList = ['love', 'hate']; +app.post('/sendit', function(req, res){ + console.log(' still gonna send it!'); + var tag = req.body.tag; + res.render('senditpage'); +}) var T = new twit(creds); io.on('connection', function (socket) { diff --git a/views/index.ejs b/views/index.ejs @@ -41,7 +41,7 @@ <div class="container-fluid bg-1 text-center"> <h3 class="margin">Whois?</h3> <img src="/images/dead-smiley-face-icon_17015.png" class="img-responsive" style="display:inline" alt="smile" width="350" height="350"> - <h3>Just Another WebApp To Show Your Twitter Stats...</h3><p><%= name%></p> + <h3>Just Another WebApp To Show Your Twitter Stats...</h3><p></p> </div> <!-- Second Container --> @@ -49,14 +49,31 @@ <div class="container-fluid bg-2 text-center"> <h3 class="margin">./Run</h3> - <p>Displaying tweets around <%=location%> </p> - <br /> - <p> <%= data %></p> + <p><h4>Check out some live tweets for a certain word or hashtag</h4> </p> + + <div align = 'center'> +<form id = 'input' action = "/sendit" action = "post"> + <div class="input-group mb-3"> + <span><input type="text"name = 'tag' class="form-control" placeholder="l0bster..." aria-label="Enter a tag..." aria-describedby="basic-addon2"></input> + <div class="input-group-append" align = 'center'> + + <span> <button id = 'submitbutton' class="btn btn-outline-secondary" type="button" value = "Submit">Submit</button></span> + + </div> + </div> +</form> +</div> </div> <!-- Third Container (Grid) --> <div class="container-fluid bg-3 text-center"> - <h3 class="margin">HOWTO</h3><br> + <h3 class="margin">HOWTO / TODO</h3><br> + <p> style the input better (button on the same line as box)</p> + <p> add the server side post action (send it route)</p> + <p> configure the client side render and display for send it route</p> + <p>do an actual whois section for the project resources and friends</p> + <p> add to lobster (feed.domain.com)</p> + <p> come up with more api features to display <div class="row"> <div class="col-sm-4"> <p>Check out the project on Github!</p> diff --git a/views/senditpage.ejs b/views/senditpage.ejs