Skip to content

Commit

Permalink
Merge pull request #168 from philcaz/main
Browse files Browse the repository at this point in the history
Fix Issue 162 HTTP 403 Forbidden Error and File Not Found Error
  • Loading branch information
Siedlerchr authored Oct 15, 2024
2 parents d870374 + 616e3cf commit f8a8674
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions journals/journal_abbreviations_mathematics.csv
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@
"Bulletin of the Institute of Combinatorics and its Applications","Bull. Inst. Combin. Appl."
"Bulletin of the Institute of Mathematics. Academia Sinica. New Series","Bull. Inst. Math. Acad. Sin. (N.S.)"
"Bulletin of the Iranian Mathematical Society","Bull. Iranian Math. Soc."
"Bulletin of the Karaganda University. Mathematics Series","Bull. Karaganda Univ. Math. Ser."
"Bulletin of the Korean Mathematical Society","Bull. Korean Math. Soc."
"Bulletin of the Kyushu Institute of Technology. Pure and Applied Mathematics","Bull. Kyushu Inst. Technol. Pure Appl. Math."
"Bulletin of the London Mathematical Society","Bull. Lond. Math. Soc."
Expand Down Expand Up @@ -744,6 +745,7 @@
"Communications in Statistics. Theory and Methods","Comm. Statist. Theory Methods"
"Communications in Theoretical Physics","Commun. Theor. Phys. (Beijing)"
"Communications of the American Mathematical Society","Comm. Amer. Math. Soc."
"Communications of the American Mathematical Society","Commun. Am. Math. Soc."
"Communications on Applied Mathematics and Computation","Commun. Appl. Math. Comput."
"Communications on Applied Nonlinear Analysis","Comm. Appl. Nonlinear Anal."
"Communications on Pure and Applied Analysis","Commun. Pure Appl. Anal."
Expand Down Expand Up @@ -812,6 +814,7 @@
"Computers and People Series","Comput. People Ser."
"Computing and Informatics","Comput. Inform."
"Computing and Visualization in Science","Comput. Vis. Sci."
"Computing in Geometry and Topology (CGT)","Comput. Geom. Topol."
"Computing. Archives for Scientific Computing","Computing"
"Concrete Operators","Concr. Oper."
"Conference Proceedings and Lecture Notes in Applied Physics","Conf. Proc. Lecture Notes Appl. Phys."
Expand Down Expand Up @@ -2348,6 +2351,7 @@
"Multiscale Modeling & Simulation. A SIAM Interdisciplinary Journal","Multiscale Model. Simul."
"Munster Journal of Mathematics","Munster J. Math."
"Munster Lectures in Mathematics","Munst. Lect. Math."
"MusMat. Brazilian Journal of Music and Mathematics","MusMat Braz. J. Music Math."
"MusMat. Brazilian Journal of Music and Mathematics","MusMat Brazil. J. Music Math."
"NASA Monographs in Systems and Software Engineering","NASA Monogr. Syst. Softw. Eng."
"NATO Advanced Science Institutes Series A: Life Sciences","NATO Adv. Sci. Inst. Ser. A Life Sci."
Expand Down Expand Up @@ -3056,6 +3060,7 @@
"Spectrum Slovakia","Spectr. Slovak."
"Spisy Pedagogicke Fakulty v Ostrave","Spisy Ped. Fak. Ostrave"
"Springer Actuarial","Springer Actuar."
"Springer Actuarial Textbooks","Springer Actuar. Textb."
"Springer Aerospace Technology","Springer Aerosp. Technol."
"Springer Biographies","Springer Biogr."
"Springer Briefs in Business","Springer Briefs Bus."
Expand Down
21 changes: 17 additions & 4 deletions scripts/update_mathscinet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@

import pandas as pd
import csv
import requests
from io import StringIO

file_in = "https://mathscinet.ams.org/msnhtml/annser.csv"
file_out = "journals/journal_abbreviations_mathematics.csv"
file_out = "../journals/journal_abbreviations_mathematics.csv" # given that /journals and /scripts are on same level

# Get the first two fields of the last version of MathSciNet data file, without empty values
df_new = pd.read_csv(file_in, usecols=[0, 1]).dropna()[
["Full Title", "Abbrev"]]
# set headers to mimic browser request
headers = {
'sec-ch-ua': '"Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36',
}
response = requests.get(file_in, headers=headers)

if response.status_code == 200:
df_new = pd.read_csv(StringIO(response.text), usecols=[0, 1]).dropna()[["Full Title", "Abbrev"]]
else:
raise Exception(f"Failed to fetch the file. Status code: {response.status_code}")

# Get our last mathematics data file
df_old = pd.read_csv(file_out, sep=",", escapechar="\\",
Expand Down

0 comments on commit f8a8674

Please sign in to comment.