Skip to content

jefftham/Lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lottery

Lottery is a project created by the Jeff Tham. This repo is run on linux at root privilege, create server on NodeJS, build https connection with letsencrypt, configurate routing by ExpressJS, scrape website with jQuery syntax by cheerio, update website and interact with user by WebSocket, and build user interface by jQueryUI & Bootstrap.

#Demo A demo of this repository can be found at yeadev.com.

Table of Contents

##Purpose

  • This is a personal project/portfolio/repository for the author to show and prove his knowlegde in JavaScript, NodeJS, ExpressJs, Websocket, jQuery, & etc.

##Reasons

  • For your information, the author does not have special interest in lottery. The reason of picking lottery as a personal project is that the author plan to implement dynamic routing by user's IP address in this project. For example, the main page will display Virginia Lottery Result if the user's IP address is in Virginia.
  • Since Lottery Results are updating frequently, it is a good challenge to parse/scrape the official websites and display the latest results.

##Achievements & Proofs

  1. It is possible to scrap or copy content from foreign/other website in Node.js
  2. A schedule can be set to pull data from foreign/other website. (better than long polling)
  3. There are a lot of better way to update the website instantly. (angular.js is not the only option, websocket is an option too)
  4. Using jQuery on Node.js is possible. (through cheerio.js)
  5. Create HTTPS server is easy and the SSL/TLS cert is free, all web servers should be running in a secure way.

##Installation ###In Linux SSH onto the machine and run the following commands:

apt-get install -y git screen

git clone https://github.com/jefftham/Lottery.git

screen -dmSL server_setup bash

screen -S server_setup -X stuff $'source Lottery/setup.sh\n'

The server will be running properly.

If you want to run node.js manually without restarting the SSH/terminal, copy & paste following code to terminal:

export NVM_DIR="/root/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

##Use The setup.sh in the repository will start the server by default.

One may run node lottery_server.js if needed.

Features

Disclaimer

The lottery logo, icon, pin are the trademark of Multi-State Lottery Association. Other trademarks are the property of their respective owners.

Lottery is intended for academic purposes and should not be treated as the final lottery result. Please refer the result to the respective official website. Use this repository or visit the website generated by this repository at your own risk.

Gambling is not encouraged!!!

If this repository violates your organization/ your right, do email the author via Jeff.Tham@email.com

Analytics

About

Display the latest lottery result

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages