getting bibtex from a url via email with Toobib

Mike Marchywka marchywka at hotmail.com
Sat Feb 12 00:18:21 CET 2022



After the extensive comments here on Toobib and Zotero, I was
trying to make Toobib available via email using my existing
"mikemail" code ( probably similar to many other packages for
automating email stuff ). I ran into a lot of little things 
however, some of them relevant to bibtex and latex hackers
while others are not. In the process, I had to hack
up some code ( the little changes before deployment )
possibly creating gross errors I have mised so far. 
Many problems were easy to anticipate- leaking temp files
for example were great for debugging but
a quick disk killer in routine usage  - and not hard to fix 
but others came up. Dealing with email and simple
security issues has been enother thing. 

My current format is to accept email with "toobib toobib" exactly
as the subject and then parse lines of the form "toobib {clip|all|about} [url]"
and then return appropriate text in a response body with bibtex in
an attached file. While the utf-8 chars may still be flakey via email,
everything else seemd fine. 
So, I could send a plain text mesage body  like this, 

toobib clip file://asdfasdfasdf
toobib clip https://127.0.0.1
toobib clip adcascascascascasa eqrqwerew
toobib about
toobib clip https://www.authorea.com/doi/full/10.22541/au.159103680.00306295
toobib clip https://arthritis-research.biomedcentral.com/articles/10.1186/s13075-020-02296-8
toobib all https://pubmed.ncbi.nlm.nih.gov/34978597/

and get a decent result as an attachment in a reply email. 
Worried that I had hard coded my return address, I tried
it from other accounts. 
Using my mom's cable
email account it looks impossible to get truly
"text/plain" as they apparently render the made up
html and call that "plain text",

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=0Atoobib clip file://asdfasdfasdf [1]=0Atoobib clip https://127.0.0.1 [=
2]=0Atoobib clip adcascascascascasa eqrqwerew=0Atoobib about=0Atoobib cl=
ip=0Ahttps://www.authorea.com/doi/full/10.22541/au.159103680.00306295 [3=
]=0Atoobib clip=0Ahttps://arthritis-research.biomedcentral.com/articles/=
10.1186/s13075-020-02296-8=0A[4]=0Atoobib all https://pubmed.ncbi.nlm.ni=
h.gov/34978597/ [5]=0A=0ALinks:=0A------=0A[1] http://chtrmail.spectrum.=
net/file://asdfasdfasdf/=0A[2] https://127.0.0.1/=0A[3] https://www.auth=
orea.com/doi/full/10.22541/au.159103680.00306295=0A[4]=0Ahttps://arthrit=
is-research.biomedcentral.com/articles/10.1186/s13075-020-02296-8=0A[5]=
 https://pubmed.ncbi.nlm.nih.gov/34978597/=0A

which decodes to (WTF, every link is messed up and most are repeated junk  ): 

 toobib clip file://asdfasdfasdf   toobib clip https://127.0.0.1 [1]
 toobib clip adcascascascascasa eqrqwerew
 toobib about
 toobib clip  [2] [3] [4] [5] [6] [7] [8] [9] [10]
[11]https://www.authorea.com/doi/full/10.22541/au.159103680.00306295
[12]
 toobib clip  [13] [14] [15] [16] [17] [18] [19] [20] [21]
[22]https://arthritis-research.biomedcentral.com/articles/10.1186/s13075-020-02296-8
[23]
 toobib all  [24] [25] [26] [27] [28] [29] [30] [31] [32]
[33]https://pubmed.ncbi.nlm.nih.gov/34978597/ [34]

After wasting almost all day on this garbage, I don't know
or care wth it is doing now... 


Note that it even inserted a "chtrmail.spectrum" in front of
my "file://" bad url in the links sectionlol. 
I don't see any amount of swearing or hacking that can fix
this now although I guess I could relax the syntax a bit to ignore
"[0-9]" and white space specifics.  

If you think you may be interested in using Toobib by email to
evaluate it or get bibtex from links for which alternatives do
not work, at some point hopefully you can send mesages to 
mjm_mailproc AT yahoo.com
with exactly "toobib toobib" in the subhect line. 
Lines in the body with no leading white space starting with
"toobib ' will be processed and acceptable commands will result
in a response whenever the server is running. For now, if you 
send in some
requests I can get some idea of the email format variability
and try to accomodate it.

I'm logging all the requests, both short form user and links,
as well as complete email. If you mail a message in a bad format
it likely won't work but I can try to fix it and replay it...


Thanks.  

-- 

mike marchywka
306 charles cox
canton GA 30115
USA, Earth 
marchywka at hotmail.com
404-788-1216
ORCID: 0000-0001-9237-455X


More information about the texhax mailing list.