├── .gitignore ├── LICENSE ├── README.md ├── alembic.ini ├── alembic ├── README ├── env.py ├── script.py.mako └── versions │ ├── 220426586e09_.py │ ├── f021f3df44c3_.py │ └── fb7131fc3951_.py ├── bin ├── auto_analyze_pdf.py ├── auto_load_arxiv.py ├── config_server.sh ├── create_db.sh ├── fetch_new_sources.py ├── restart_app.sh └── start_supervisord.sh ├── cron.txt ├── data └── twitter_watching_list.txt ├── deployment ├── nginx.conf └── supervisor.conf ├── dlmonitor ├── __init__.py ├── analyzer.py ├── db.py ├── db_models.py ├── fetcher.py ├── latex.py ├── settings.py ├── sources │ ├── __init__.py │ ├── arxivsrc.py │ ├── base.py │ └── twittersrc.py └── webapp │ ├── __init__.py │ ├── app.py │ ├── static │ ├── LaTeXML.css │ ├── app.js │ ├── default.css │ ├── fonts.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── ltx-article.css │ └── mobile.css │ └── templates │ ├── about.html │ ├── index.html │ ├── post_arxiv.html │ ├── post_twitter.html │ ├── search.html │ ├── single.html │ └── track.html ├── models └── .keep ├── requirements.txt └── tests ├── test_arxiv_fetch.py ├── test_arxiv_get.py ├── test_pdf_analyzer.py ├── test_praw.py └── test_twitter_api.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DLMonitor: Monitoring all things happening in deep learning 2 | 3 | ### Purpose 4 | 5 | This project aims to save time and energy for deep learning folks. 6 | It monitors new things on multiple sources and find out those important to you. 7 | Currently, the data sources include: 8 | 9 | - Arxiv papers 10 | - Tweets 11 | - Reddit posts 12 | 13 | Take a look at the public server: https://deeplearn.org 14 | 15 | ### Install 16 | 17 | 1. Install postgres server 18 | 2. `pip install -r requirements.txt` 19 | 3. `sudo apt-get install poppler-utils` 20 | 21 | ### Setup database 22 | 23 | 1. Create a `.env` file in the project root. 24 | 25 | ``` 26 | DATABASE_USER=dlmonitor 27 | DATABASE_PASSWD=something 28 | 29 | TWITTER_CONSUMER_KEY=something 30 | TWITTER_CONSUMER_SECRET=something 31 | TWITTER_ACCESS_TOKEN=something 32 | TWITTER_ACCESS_SECRET=something 33 | 34 | SUPERVISORD_PASSWD=something 35 | ``` 36 | 37 | 2. Create database 38 | 39 | Run `bash bin/create_db.sh` 40 | 41 | 42 | ### Install Quick Read dependencies 43 | 44 | 1. install cpan 45 | 2. install text::Unidecode in cpan 46 | 3. git clone https://github.com/brucemiller/LaTeXML 47 | 4. perl Makefile.PL; make; make install 48 | 49 | ### Fetch resources 50 | 51 | Fetch Arxiv papers and tweets. 52 | 53 | ```bash 54 | python bin/fetch_new_sources.py all 55 | ``` 56 | 57 | ### Run test server 58 | 59 | ```bash 60 | PYTHONPATH="." python dlmonitor/webapp/app.py 61 | ``` 62 | 63 | ### Setup production server 64 | 65 | 1. Install nginx 66 | 67 | 2. Copy configuration files for supervisord and nignx 68 | 69 | ```bash 70 | bash bin/config_server.sh 71 | ``` 72 | 73 | 3. Start Gunicorn processes through supervisord 74 | 75 | ```bash 76 | bash bin/start_supervisord.sh 77 | ``` 78 | 4. Start arxiv source loading worker 79 | 80 | ```bash 81 | PYTHONPATH="." python bin/auto_load_arxiv.py --forever 82 | ``` 83 | -------------------------------------------------------------------------------- /alembic.ini: -------------------------------------------------------------------------------- 1 | # A generic, single database configuration. 2 | 3 | [alembic] 4 | # path to migration scripts 5 | script_location = alembic 6 | 7 | # template used to generate migration files 8 | # file_template = %%(rev)s_%%(slug)s 9 | 10 | # timezone to use when rendering the date 11 | # within the migration file as well as the filename. 12 | # string value is passed to dateutil.tz.gettz() 13 | # leave blank for localtime 14 | # timezone = 15 | 16 | # max length of characters to apply to the 17 | # "slug" field 18 | #truncate_slug_length = 40 19 | 20 | # set to 'true' to run the environment during 21 | # the 'revision' command, regardless of autogenerate 22 | # revision_environment = false 23 | 24 | # set to 'true' to allow .pyc and .pyo files without 25 | # a source .py file to be detected as revisions in the 26 | # versions/ directory 27 | # sourceless = false 28 | 29 | # version location specification; this defaults 30 | # to alembic/versions. When using multiple version 31 | # directories, initial revisions must be specified with --version-path 32 | # version_locations = %(here)s/bar %(here)s/bat alembic/versions 33 | 34 | # the output encoding used when revision files 35 | # are written from script.py.mako 36 | # output_encoding = utf-8 37 | 38 | sqlalchemy.url = driver://user:pass@localhost/dbname 39 | 40 | 41 | # Logging configuration 42 | [loggers] 43 | keys = root,sqlalchemy,alembic 44 | 45 | [handlers] 46 | keys = console 47 | 48 | [formatters] 49 | keys = generic 50 | 51 | [logger_root] 52 | level = WARN 53 | handlers = console 54 | qualname = 55 | 56 | [logger_sqlalchemy] 57 | level = WARN 58 | handlers = 59 | qualname = sqlalchemy.engine 60 | 61 | [logger_alembic] 62 | level = INFO 63 | handlers = 64 | qualname = alembic 65 | 66 | [handler_console] 67 | class = StreamHandler 68 | args = (sys.stderr,) 69 | level = NOTSET 70 | formatter = generic 71 | 72 | [formatter_generic] 73 | format = %(levelname)-5.5s [%(name)s] %(message)s 74 | datefmt = %H:%M:%S 75 | -------------------------------------------------------------------------------- /alembic/README: -------------------------------------------------------------------------------- 1 | Generic single-database configuration. -------------------------------------------------------------------------------- /alembic/env.py: -------------------------------------------------------------------------------- 1 | from __future__ import with_statement 2 | from alembic import context 3 | from sqlalchemy import engine_from_config, pool 4 | from logging.config import fileConfig 5 | import os, sys 6 | 7 | dir_path = os.path.dirname(os.path.realpath(__file__)) 8 | parent_path = os.path.dirname(dir_path) 9 | sys.path.append(parent_path) 10 | import dlmonitor 11 | from dlmonitor.db_models import Base 12 | from dlmonitor.settings import DATABASE_URL 13 | 14 | # add your model's MetaData object here 15 | # for 'autogenerate' support 16 | target_metadata = Base.metadata 17 | 18 | 19 | 20 | def run_migrations_offline(): 21 | """Run migrations in 'offline' mode. 22 | 23 | This configures the context with just a URL 24 | and not an Engine, though an Engine is acceptable 25 | here as well. By skipping the Engine creation 26 | we don't even need a DBAPI to be available. 27 | 28 | Calls to context.execute() here emit the given string to the 29 | script output. 30 | 31 | """ 32 | context.configure( 33 | url=DATABASE_URL, target_metadata=target_metadata, literal_binds=True) 34 | 35 | with context.begin_transaction(): 36 | context.run_migrations() 37 | 38 | 39 | def run_migrations_online(): 40 | """Run migrations in 'online' mode. 41 | 42 | In this scenario we need to create an Engine 43 | and associate a connection with the context. 44 | 45 | """ 46 | from dlmonitor.db import engine 47 | 48 | with engine.connect() as connection: 49 | context.configure( 50 | connection=connection, 51 | target_metadata=target_metadata 52 | ) 53 | 54 | with context.begin_transaction(): 55 | context.run_migrations() 56 | 57 | if context.is_offline_mode(): 58 | run_migrations_offline() 59 | else: 60 | run_migrations_online() 61 | -------------------------------------------------------------------------------- /alembic/script.py.mako: -------------------------------------------------------------------------------- 1 | """${message} 2 | 3 | Revision ID: ${up_revision} 4 | Revises: ${down_revision | comma,n} 5 | Create Date: ${create_date} 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | ${imports if imports else ""} 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = ${repr(up_revision)} 14 | down_revision = ${repr(down_revision)} 15 | branch_labels = ${repr(branch_labels)} 16 | depends_on = ${repr(depends_on)} 17 | 18 | 19 | def upgrade(): 20 | ${upgrades if upgrades else "pass"} 21 | 22 | 23 | def downgrade(): 24 | ${downgrades if downgrades else "pass"} 25 | -------------------------------------------------------------------------------- /alembic/versions/220426586e09_.py: -------------------------------------------------------------------------------- 1 | """empty message 2 | 3 | Revision ID: 220426586e09 4 | Revises: f021f3df44c3 5 | Create Date: 2017-06-12 23:11:24.491957 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = '220426586e09' 14 | down_revision = 'f021f3df44c3' 15 | branch_labels = None 16 | depends_on = None 17 | 18 | 19 | def upgrade(): 20 | # ### commands auto generated by Alembic - please adjust! ### 21 | op.add_column('arxiv', sa.Column('analyzed', sa.Boolean(), server_default='false', nullable=True)) 22 | # ### end Alembic commands ### 23 | 24 | 25 | def downgrade(): 26 | # ### commands auto generated by Alembic - please adjust! ### 27 | op.drop_column('arxiv', 'analyzed') 28 | # ### end Alembic commands ### 29 | -------------------------------------------------------------------------------- /alembic/versions/f021f3df44c3_.py: -------------------------------------------------------------------------------- 1 | """empty message 2 | 3 | Revision ID: f021f3df44c3 4 | Revises: 5 | Create Date: 2017-06-11 08:47:34.456800 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = 'f021f3df44c3' 14 | down_revision = None 15 | branch_labels = None 16 | depends_on = None 17 | 18 | 19 | def upgrade(): 20 | # ### commands auto generated by Alembic - please adjust! ### 21 | op.add_column('arxiv', sa.Column('conclusion', sa.Text(collation=''), nullable=True)) 22 | op.add_column('arxiv', sa.Column('introduction', sa.Text(collation=''), nullable=True)) 23 | # ### end Alembic commands ### 24 | 25 | 26 | def downgrade(): 27 | # ### commands auto generated by Alembic - please adjust! ### 28 | op.drop_column('arxiv', 'introduction') 29 | op.drop_column('arxiv', 'conclusion') 30 | # ### end Alembic commands ### 31 | -------------------------------------------------------------------------------- /alembic/versions/fb7131fc3951_.py: -------------------------------------------------------------------------------- 1 | """empty message 2 | 3 | Revision ID: fb7131fc3951 4 | Revises: 220426586e09 5 | Create Date: 2019-06-14 10:51:38.034897 6 | 7 | """ 8 | from alembic import op 9 | import sqlalchemy as sa 10 | 11 | 12 | # revision identifiers, used by Alembic. 13 | revision = 'fb7131fc3951' 14 | down_revision = '220426586e09' 15 | branch_labels = None 16 | depends_on = None 17 | 18 | 19 | def upgrade(): 20 | # ### commands auto generated by Alembic - please adjust! ### 21 | op.create_table('working', 22 | sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), 23 | sa.Column('type', sa.String(length=255), nullable=True), 24 | sa.Column('param', sa.String(length=255), nullable=True), 25 | sa.PrimaryKeyConstraint('id') 26 | ) 27 | # ### end Alembic commands ### 28 | 29 | 30 | def downgrade(): 31 | # ### commands auto generated by Alembic - please adjust! ### 32 | op.drop_table('working') 33 | # ### end Alembic commands ### 34 | -------------------------------------------------------------------------------- /bin/auto_analyze_pdf.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | sys.path.append(".") 3 | from dlmonitor.db import session_scope, ArxivModel 4 | from dlmonitor.analyzer import PDFAnalyzer 5 | from dlmonitor.settings import PDF_PATH 6 | from sqlalchemy import desc 7 | from argparse import ArgumentParser 8 | import logging 9 | import time 10 | logging.basicConfig(level=logging.INFO) 11 | 12 | if __name__ == '__main__': 13 | ap = ArgumentParser() 14 | ap.add_argument("--forever", action="store_true") 15 | args = ap.parse_args() 16 | analyzer = PDFAnalyzer() 17 | with session_scope() as session: 18 | run_flag = True 19 | while run_flag: 20 | papers = session.query(ArxivModel).filter(ArxivModel.analyzed.is_(False)).order_by(desc(ArxivModel.published_time)).limit(20).all() 21 | for paper in papers: 22 | pdf_url = paper.pdf_url + ".pdf" 23 | pdf_fn = os.path.basename(pdf_url) 24 | save_path = "{}/{}".format(PDF_PATH, pdf_fn) 25 | if not os.path.exists(save_path): 26 | logging.info("download {}".format(pdf_fn)) 27 | os.system("wget -O {} --user-agent=Lynx {}".format(save_path, pdf_url)) 28 | time.sleep(1) 29 | result = analyzer.run(save_path) 30 | if not result: 31 | raise SystemError 32 | if result["introduction"]: 33 | paper.introduction = result["introduction"].replace("\0", "") 34 | if result["conclusion"]: 35 | paper.conclusion = result["conclusion"].replace("\0", "") 36 | paper.analyzed = True 37 | logging.info("{} INTRO:{} CONCLUSION:{}".format(paper.pdf_url, "o" if result["introduction"] else "x", "o" if result["conclusion"] else "x")) 38 | session.commit() 39 | if not args.forever: 40 | # beak 41 | run_flag = False 42 | -------------------------------------------------------------------------------- /bin/auto_load_arxiv.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | sys.path.append(".") 3 | from dlmonitor.db import session_scope 4 | from dlmonitor.db_models import WorkingQueueModel 5 | from dlmonitor.latex import build_paper_html, retrieve_paper_html 6 | from dlmonitor.settings import SOURCE_PATH 7 | from sqlalchemy import desc 8 | from argparse import ArgumentParser 9 | from sqlalchemy.sql.expression import func 10 | import logging 11 | import time 12 | logging.basicConfig(level=logging.INFO) 13 | 14 | if __name__ == '__main__': 15 | ap = ArgumentParser() 16 | ap.add_argument("--forever", action="store_true") 17 | args = ap.parse_args() 18 | with session_scope() as session: 19 | run_flag = True 20 | while run_flag: 21 | jobs = session.query(WorkingQueueModel).filter(WorkingQueueModel.type == "load_arxiv").order_by(func.random()).limit(5).all() 22 | logging.info("get {} jobs".format(len(jobs))) 23 | for job in jobs: 24 | arxiv_token = job.param 25 | if os.path.exists("{}/{}".format(SOURCE_PATH, arxiv_token)): 26 | session.delete(job) 27 | continue 28 | if not arxiv_token.startswith("19") and not arxiv_token.startswith("18"): 29 | session.delete(job) 30 | continue 31 | try: 32 | build_paper_html(arxiv_token) 33 | except: 34 | continue 35 | logging.info("built {}".format(arxiv_token)) 36 | session.delete(job) 37 | session.commit() 38 | if not jobs: 39 | time.sleep(3) 40 | if not args.forever: 41 | # beak 42 | run_flag = False 43 | -------------------------------------------------------------------------------- /bin/config_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Run this find directly on server. 4 | # 5 | source .env 6 | 7 | mkdir -p /etc/supervisor/conf.d/ 8 | mkdir -p /var/logs/gunicorn/ 9 | 10 | cp deployment/nginx.conf /etc/nginx/sites-enabled/nginx_dlmonitor.conf 11 | cat deployment/supervisor.conf | sed -E "s/PASSWD/${SUPERVISORD_PASSWD}/g" > /etc/supervisor/conf.d/supervisord.conf 12 | -------------------------------------------------------------------------------- /bin/create_db.sh: -------------------------------------------------------------------------------- 1 | source ./.env 2 | sudo -u postgres psql -c "create user $DATABASE_USER createdb createuser password 3 | '$DATABASE_PASSWD';" 4 | sudo -u postgres psql -c "create database dlmonitor owner $DATABASE_USER;" 5 | -------------------------------------------------------------------------------- /bin/fetch_new_sources.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.fetcher import fetch_sources 4 | from argparse import ArgumentParser 5 | import logging 6 | logging.basicConfig(level=logging.INFO) 7 | 8 | if __name__ == '__main__': 9 | ap = ArgumentParser() 10 | ap.add_argument("src", help="source name: arxiv, twitter, youtube, reddit") 11 | args = ap.parse_args() 12 | 13 | if args.src == "all": 14 | # Okay, you want to get all things 15 | fetch_sources("arxiv") 16 | fetch_sources("twitter") 17 | else: 18 | fetch_sources(args.src) 19 | -------------------------------------------------------------------------------- /bin/restart_app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | supervisorctl -c /etc/supervisor/conf.d/supervisord.conf restart dlmonitor 3 | -------------------------------------------------------------------------------- /bin/start_supervisord.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | supervisord -c /etc/supervisor/conf.d/supervisord.conf 3 | supervisorctl -c /etc/supervisor/conf.d/supervisord.conf restart dlmonitor 4 | -------------------------------------------------------------------------------- /cron.txt: -------------------------------------------------------------------------------- 1 | # Please change the path to your project here 2 | 30 * * * * ({ PYTHONPATH="/home/backend/dlmonitor" /usr/bin/python /home/backend/dlmonitor/bin/fetch_new_sources.py all; } | tee /tmp/1cxcTJCSsvy8LIA3.stdout) 3>&1 1>&2 2>&3 | tee /tmp/1cxcTJCSsvy8LIA3.stderr 3 | -------------------------------------------------------------------------------- /data/twitter_watching_list.txt: -------------------------------------------------------------------------------- 1 | #deeplearning 2 | arxiv.org 3 | @deeplearning_jp 4 | @dl_weekly 5 | @DeepLearningHub 6 | @AndrewYNg 7 | @NandoDF 8 | @ylecun 9 | @DeepMindAI 10 | @lmthang 11 | @hardmaru 12 | @neubig 13 | @RandomlyWalking 14 | @kchonyc 15 | @RichardSocher 16 | @nsaphra 17 | @jmgomez 18 | @raphaelshu 19 | @yoavgo 20 | @goodfellow_ian 21 | @soumithchintala 22 | @mxlearn 23 | @googleresearch 24 | @demishassabis 25 | @GoogleBrain 26 | @OpenAI 27 | @ilyasut 28 | @sedielem 29 | @karpathy 30 | @fchollet 31 | @hugo_larochelle 32 | @OriolVinyalsML 33 | @stanfordnlp 34 | @Miles_Brundage 35 | -------------------------------------------------------------------------------- /deployment/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name deeplearn.org; 4 | 5 | root /home/backend/dlmonitor/dlmonitor/webapp; 6 | 7 | # access_log /var/log/nginx/dc_access.log; 8 | error_log /var/log/nginx/dc_error.log; 9 | 10 | location / { 11 | proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; 12 | proxy_set_header Host $http_host; 13 | proxy_redirect off; 14 | if (!-f $request_filename) { 15 | proxy_pass http://127.0.0.1:8000; 16 | break; 17 | } 18 | } 19 | 20 | location /static { 21 | alias /home/backend/dlmonitor/dlmonitor/webapp/static/; 22 | autoindex on; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /deployment/supervisor.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/tmp/supervisor.sock ; (the path to the socket file) 3 | ;chmod=0700 ; socket file mode (default 0700) 4 | ;chown=nobody:nogroup ; socket file uid:gid owner 5 | ;username=user ; (default is no username (open server)) 6 | ;password=123 ; (default is no password (open server)) 7 | 8 | ;[inet_http_server] ; inet (TCP) server disabled by default 9 | ;port=0.0.0.0:9001 ; (ip_address:port specifier, *:port for all iface) 10 | ;username=dlmonitor ; (default is no username (open server)) 11 | ;password=PASSWD ; (default is no password (open server)) 12 | 13 | [supervisord] 14 | logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) 15 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 16 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 17 | loglevel=info ; (log level;default info; others: debug,warn,trace) 18 | pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 19 | nodaemon=false ; (start in foreground if true;default false) 20 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 21 | minprocs=200 ; (min. avail process descriptors;default 200) 22 | ;umask=022 ; (process file creation umask;default 022) 23 | ;user=chrism ; (default is current user, required if root) 24 | ;identifier=supervisor ; (supervisord identifier, default is 'supervisor') 25 | ;directory=/tmp ; (default is not to cd during start) 26 | ;nocleanup=true ; (don't clean up tempfiles at start;default false) 27 | ;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP) 28 | ;environment=KEY="value" ; (key value pairs to add to environment) 29 | ;strip_ansi=false ; (strip ansi escape codes in logs; def. false) 30 | 31 | ; the below section must remain in the config file for RPC 32 | ; (supervisorctl/web interface) to work, additional interfaces may be 33 | ; added by defining them in separate rpcinterface: sections 34 | [rpcinterface:supervisor] 35 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 36 | 37 | [supervisorctl] 38 | serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket 39 | ;serverurl=http://0.0.0.0:9001 ; use an http:// url to specify an inet socket 40 | ;username=dlmonitor ; should be same as http_username if set 41 | ;password=PASSWD ; should be same as http_password if set 42 | ;prompt=mysupervisor ; cmd line prompt (default "supervisor") 43 | ;history_file=~/.sc_history ; use readline history if available 44 | 45 | ; The below sample program section shows all possible program subsection values, 46 | ; create one or more 'real' program: sections to be able to control them under 47 | ; supervisor. 48 | 49 | ;[program:theprogramname] 50 | ;command=/bin/cat ; the program (relative uses PATH, can take args) 51 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 52 | ;numprocs=1 ; number of processes copies to start (def 1) 53 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 54 | ;umask=022 ; umask for process (default None) 55 | ;priority=999 ; the relative start priority (default 999) 56 | ;autostart=true ; start at supervisord start (default: true) 57 | ;startsecs=1 ; # of secs prog must stay up to be running (def. 1) 58 | ;startretries=3 ; max # of serial start failures when starting (default 3) 59 | ;autorestart=unexpected ; when to restart if exited after running (def: unexpected) 60 | ;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2) 61 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 62 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 63 | ;stopasgroup=false ; send stop signal to the UNIX process group (default false) 64 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 65 | ;user=chrism ; setuid to this UNIX account to run the program 66 | ;redirect_stderr=true ; redirect proc stderr to stdout (default false) 67 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 68 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 69 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) 70 | ;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 71 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 72 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 73 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 74 | ;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10) 75 | ;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 76 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 77 | ;environment=A="1",B="2" ; process environment additions (def no adds) 78 | ;serverurl=AUTO ; override serverurl computation (childutils) 79 | 80 | ; The below sample eventlistener section shows all possible 81 | ; eventlistener subsection values, create one or more 'real' 82 | ; eventlistener: sections to be able to handle event notifications 83 | ; sent by supervisor. 84 | 85 | ;[eventlistener:theeventlistenername] 86 | ;command=/bin/eventlistener ; the program (relative uses PATH, can take args) 87 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 88 | ;numprocs=1 ; number of processes copies to start (def 1) 89 | ;events=EVENT ; event notif. types to subscribe to (req'd) 90 | ;buffer_size=10 ; event buffer queue size (default 10) 91 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 92 | ;umask=022 ; umask for process (default None) 93 | ;priority=-1 ; the relative start priority (default -1) 94 | ;autostart=true ; start at supervisord start (default: true) 95 | ;startsecs=1 ; # of secs prog must stay up to be running (def. 1) 96 | ;startretries=3 ; max # of serial start failures when starting (default 3) 97 | ;autorestart=unexpected ; autorestart if exited after running (def: unexpected) 98 | ;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2) 99 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 100 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 101 | ;stopasgroup=false ; send stop signal to the UNIX process group (default false) 102 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 103 | ;user=chrism ; setuid to this UNIX account to run the program 104 | ;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners 105 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 106 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 107 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) 108 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 109 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 110 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 111 | ;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10) 112 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 113 | ;environment=A="1",B="2" ; process environment additions 114 | ;serverurl=AUTO ; override serverurl computation (childutils) 115 | 116 | ; The below sample group section shows all possible group values, 117 | ; create one or more 'real' group: sections to create "heterogeneous" 118 | ; process groups. 119 | 120 | ;[group:thegroupname] 121 | ;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions 122 | ;priority=999 ; the relative start priority (default 999) 123 | 124 | ; The [include] section can just contain the "files" setting. This 125 | ; setting can list multiple files (separated by whitespace or 126 | ; newlines). It can also contain wildcards. The filenames are 127 | ; interpreted as relative to this file. Included files *cannot* 128 | ; include files themselves. 129 | 130 | ;[include] 131 | ;files = relative/directory/*.ini 132 | 133 | [program:dlmonitor] 134 | command = gunicorn --pythonpath /home/backend/dlmonitor dlmonitor.webapp:app -w 4 135 | directory = /home/backend/dlmonitor/ 136 | user = deploy 137 | stdout_logfile = /tmp/gunicorn_stdout.log 138 | stderr_logfile = /tmp/gunicorn_stderr.log 139 | redirect_stderr = True 140 | environment = PRODUCTION=1 141 | -------------------------------------------------------------------------------- /dlmonitor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/dlmonitor/__init__.py -------------------------------------------------------------------------------- /dlmonitor/analyzer.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | import re 3 | 4 | TMP_PATH = "/tmp/analyzed_pdf.txt" 5 | OUTLINE_PATH = "/tmp/analyzed_pdf_outline.txt" 6 | 7 | class PDFAnalyzer(object): 8 | """ 9 | Analyze the content of PDF files. 10 | This class relies on PDFminer. 11 | """ 12 | 13 | def run(self, path): 14 | """ 15 | Extract introduction and conslusion text from PDF. 16 | """ 17 | if not os.path.exists(path): 18 | return None 19 | os.system("pdf2txt.py {} > {}".format(path, TMP_PATH)) 20 | os.system("dumppdf.py -T {} > {}".format(path, OUTLINE_PATH)) 21 | if not os.path.exists(TMP_PATH) or not os.path.exists(OUTLINE_PATH): 22 | return None 23 | # Extract outlines 24 | outline_content = open(OUTLINE_PATH).read() 25 | titles = re.findall(r'title="([^"]+)"', outline_content) 26 | if titles: 27 | return self.extract_with_outline(titles) 28 | else: 29 | return self.extract_without_outline() 30 | 31 | def extract_with_outline(self, titles): 32 | """ 33 | Actually, with an outline, any section can be extracted easily. 34 | """ 35 | titles.append("References") # Manually add a section, in case missing refrence section 36 | intro_titles = filter(lambda t: "introduction" in t.lower(), titles) 37 | conclusion_titles = filter(lambda t: "conclusion" in t.lower(), titles) 38 | if intro_titles: 39 | intro_title = intro_titles[0] 40 | intro_words = intro_title.split() 41 | alter_intro_title = " ".join(intro_words[1:]) if len(intro_words) > 1 else intro_title 42 | intro_word_n = len(intro_title.split()) 43 | for idx in range(titles.index(intro_title) + 1, len(titles)): 44 | intro_end_title = titles[idx] 45 | if intro_end_title.count(".") > intro_title.count("."): 46 | continue 47 | words = intro_end_title.split() 48 | alter_intro_end_title = " ".join(words[1:]) if len(words) > 1 else intro_end_title 49 | intro_end_word_n = len(intro_end_title.split()) 50 | break 51 | else: 52 | intro_title = None 53 | intro_word_n = 0 54 | if conclusion_titles: 55 | conclusion_title = conclusion_titles[-1] 56 | words = conclusion_title.split() 57 | alter_conclusion_title = " ".join(words[1:]) if len(words) > 1 else conclusion_title 58 | conclusion_word_n = len(conclusion_title.split()) 59 | for idx in range(titles.index(conclusion_title) + 1, len(titles)): 60 | conclusion_end_title = titles[idx] 61 | if conclusion_end_title.count(".") > conclusion_end_title.count("."): 62 | continue 63 | words = conclusion_end_title.split() 64 | alter_conclusion_end_title = " ".join(words[1:]) if len(words) > 1 else conclusion_end_title 65 | conclusion_end_word_n = len(conclusion_end_title.split()) 66 | break 67 | else: 68 | conclusion_title = None 69 | conclusion_word_n = 0 70 | # Analyze lines, just in the same manner of the code without outlines 71 | # So, may be the two functions can be merged 72 | lines = open(TMP_PATH).readlines() 73 | intro_buf = "" 74 | conclusion_buf = "" 75 | intro_success = False 76 | conclusion_success = False 77 | mode = "none" 78 | skipping = False 79 | for line in lines: 80 | line = line.strip() 81 | words = line.split() 82 | if mode == "none" and intro_title and abs(len(words) - intro_word_n) <= 1 and ( 83 | intro_title in line or intro_title.upper() in line or 84 | alter_intro_title in line or alter_intro_title.upper() in line 85 | ): 86 | mode = "introduction" 87 | elif (mode == "introduction" and abs(len(words) - intro_end_word_n) <= 1 and ( 88 | intro_end_title in line or intro_end_title.upper() in line or 89 | alter_intro_end_title in line or alter_intro_end_title.upper() in line 90 | )): 91 | mode = "none" 92 | intro_success = True 93 | elif mode == "none" and conclusion_title and abs(len(words) - conclusion_word_n) <= 1 and ( 94 | conclusion_title in line or conclusion_title.upper() in line or 95 | alter_conclusion_title in line or alter_conclusion_title.upper() in line 96 | ): 97 | mode = "conclusion" 98 | elif (mode == "conclusion" and abs(len(words) - conclusion_end_word_n) <= 1 and ( 99 | conclusion_end_title in line or conclusion_end_title.upper() in line or 100 | alter_conclusion_end_title in line or alter_conclusion_end_title.upper() in line 101 | )): 102 | mode = "none" 103 | conclusion_success = True 104 | elif mode != "none": 105 | # Recording mode 106 | if skipping and len(words) > 1 and line[-1] != ".": 107 | continue 108 | else: 109 | skipping = False 110 | # Skip one-word lines 111 | if len(words) <= 1: continue 112 | # Skip Table, Figure 113 | if line.startswith("Figure ") or line.startswith("Table "): 114 | if line[-1] != ".": 115 | skipping = True 116 | continue 117 | if mode == "introduction": 118 | intro_buf += line + " " 119 | elif mode == "conclusion": 120 | conclusion_buf += line + " " 121 | ret = { 122 | "introduction": intro_buf if intro_success else None, 123 | "conclusion": conclusion_buf if conclusion_success else None 124 | } 125 | return ret 126 | 127 | def extract_without_outline(self): 128 | """ 129 | No outline, just extract with hand-craft rules written by Raphael Shu. 130 | Success rate: 15%. 131 | """ 132 | lines = open(TMP_PATH).readlines() 133 | intro_buf = "" 134 | conclusion_buf = "" 135 | intro_success = False 136 | conclusion_success = False 137 | mode = "none" 138 | skipping = False 139 | for line in lines: 140 | line = line.strip() 141 | words = line.split() 142 | if mode == "none" and line == "Introduction" or len(words) <= 3 and ( 143 | line == "1 Introduction" or line == "1. Introduction" or line == "I. Introduction" 144 | ): 145 | mode = "introduction" 146 | elif (mode == "introduction" and ( 147 | (len(words) == 6 and (words[0] == "2" or words[0] == "2." or words[0] == "II.") and words[1][0] == words[1][0].upper()) 148 | or 149 | (line == "Related Work") 150 | )): 151 | mode = "none" 152 | intro_success = True 153 | elif mode == "none" and len(words) <= 4 and len(words) >= 1 and ( 154 | words[0].startswith("Conclusion") 155 | or 156 | (len(words) > 1 and words[1].startswith("Conclusion")) 157 | ): 158 | mode = "conclusion" 159 | elif mode == "conclusion" and line == "References": 160 | mode = "none" 161 | conclusion_success = True 162 | elif mode != "none": 163 | # Recording mode 164 | if skipping and len(words) > 1 and line[-1] != ".": 165 | continue 166 | else: 167 | skipping = False 168 | # Skip one-word lines 169 | if len(words) <= 1: continue 170 | # Skip Table, Figure 171 | if line.startswith("Figure ") or line.startswith("Table "): 172 | if line[-1] != ".": 173 | skipping = True 174 | continue 175 | if mode == "introduction": 176 | intro_buf += line + " " 177 | elif mode == "conclusion": 178 | conclusion_buf += line + " " 179 | ret = { 180 | "introduction": intro_buf if intro_success else None, 181 | "conclusion": conclusion_buf if conclusion_success else None 182 | } 183 | return ret 184 | -------------------------------------------------------------------------------- /dlmonitor/db.py: -------------------------------------------------------------------------------- 1 | import sqlalchemy 2 | from sqlalchemy.orm import sessionmaker 3 | from contextlib import contextmanager 4 | 5 | 6 | from . import settings 7 | from db_models import Base, ArxivModel, TwitterModel 8 | 9 | def create_engine(**kwargs): 10 | return sqlalchemy.create_engine(settings.DATABASE_URL, **kwargs) 11 | 12 | if 'Session' not in globals(): 13 | engine = create_engine() 14 | sqlalchemy.orm.configure_mappers() 15 | Session = sessionmaker(bind=engine) 16 | 17 | def get_global_session(): 18 | global global_session 19 | if 'global_session' not in globals() or global_session is None: 20 | global_session = Session() 21 | return global_session 22 | 23 | def close_global_session(): 24 | global global_session 25 | global_session.close() 26 | global_session = None 27 | 28 | @contextmanager 29 | def session_scope(): 30 | global Session 31 | session = Session() 32 | try: 33 | yield session 34 | session.commit() 35 | except Exception as e: 36 | session.rollback() 37 | raise e 38 | finally: 39 | session.close() 40 | -------------------------------------------------------------------------------- /dlmonitor/db_models.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from sqlalchemy import Column, Integer, String, ForeignKey, Text, DateTime, Unicode, Boolean 3 | from sqlalchemy.orm import relationship 4 | from sqlalchemy.ext.declarative import declarative_base 5 | from sqlalchemy_searchable import make_searchable 6 | from sqlalchemy_utils.types import TSVectorType 7 | 8 | if 'Base' not in globals(): 9 | Base = declarative_base() 10 | make_searchable() 11 | 12 | def str_repr(string): 13 | if sys.version_info.major == 3: 14 | return string 15 | else: 16 | return string.encode('utf-8') 17 | 18 | class ArxivModel(Base): 19 | 20 | __tablename__ = 'arxiv' 21 | 22 | id = Column(Integer, primary_key=True, autoincrement=True) 23 | version = Column(Integer) 24 | popularity = Column(Integer) 25 | title = Column(Unicode(800, collation='')) 26 | arxiv_url = Column(String(255), primary_key=True) 27 | pdf_url = Column(String(255)) 28 | published_time = Column(DateTime()) 29 | authors = Column(Unicode(800, collation='')) 30 | abstract = Column(Text(collation='')) 31 | journal_link = Column(Text(collation=''), nullable=True) 32 | tag = Column(String(255)) 33 | introduction = Column(Text(collation='')) 34 | conclusion = Column(Text(collation='')) 35 | analyzed = Column(Boolean, server_default='false', default=False) 36 | 37 | # For full text search 38 | search_vector = Column( 39 | TSVectorType('title', 'abstract', 'authors', weights={'title': 'A', 'abstract': 'B', 'authors': 'C'})) 40 | 41 | def __repr__(self): 42 | template = '' 43 | return str_repr(template.format(self.id, self.arxiv_url)) 44 | 45 | class TwitterModel(Base): 46 | 47 | __tablename__ = 'twitter' 48 | 49 | id = Column(Integer, primary_key=True, autoincrement=True) 50 | tweet_id = Column(String(20), primary_key=True) 51 | popularity = Column(Integer) 52 | pic_url = Column(String(255), nullable=True) 53 | published_time = Column(DateTime()) 54 | user = Column(Unicode(255)) 55 | text = Column(Text()) 56 | 57 | # For full text search 58 | search_vector = Column(TSVectorType('text')) 59 | 60 | def __repr__(self): 61 | template = '' 62 | return str_repr(template.format(self.id, self.user)) 63 | 64 | class WorkingQueueModel(Base): 65 | 66 | __tablename__ = "working" 67 | 68 | id = Column(Integer, primary_key=True, autoincrement=True) 69 | type = Column(String(255), nullable=True) 70 | param = Column(String(255), nullable=True) 71 | 72 | def __repr__(self): 73 | return __tablename__ + self.id 74 | -------------------------------------------------------------------------------- /dlmonitor/fetcher.py: -------------------------------------------------------------------------------- 1 | """ 2 | A class for fetching all sources. 3 | """ 4 | 5 | from sources.arxivsrc import ArxivSource 6 | from sources.twittersrc import TwitterSource 7 | from db import Base, engine 8 | 9 | def get_source(src_name): 10 | if src_name == 'arxiv': 11 | return ArxivSource() 12 | elif src_name == 'twitter': 13 | return TwitterSource() 14 | else: 15 | raise NotImplementedError 16 | 17 | def fetch_sources(src_name, fetch_all=False): 18 | global Base, engine 19 | Base.metadata.create_all(engine) 20 | src = get_source(src_name) 21 | if fetch_all: 22 | src.fetch_all() 23 | else: 24 | src.fetch_new() 25 | 26 | def get_posts(src_name, keywords=None, since=None, start=0, num=100): 27 | src = get_source(src_name) 28 | return src.get_posts(keywords=keywords, since=since, start=start, num=num) 29 | -------------------------------------------------------------------------------- /dlmonitor/latex.py: -------------------------------------------------------------------------------- 1 | import urllib2 2 | import os 3 | import shlex 4 | from subprocess import Popen, PIPE 5 | from threading import Timer 6 | 7 | from dlmonitor import settings 8 | 9 | def execute_with_timeout(cmd): 10 | proc = Popen(shlex.split(cmd)) 11 | timer = Timer(5 * 60, proc.kill) 12 | try: 13 | timer.start() 14 | proc.communicate() 15 | finally: 16 | timer.cancel() 17 | 18 | def build_paper_html(arxiv_id): 19 | src_path = "{}/{}".format(settings.SOURCE_PATH, arxiv_id) 20 | html_path = "{}/main.html".format(src_path) 21 | if os.path.exists(src_path): 22 | return html_path if os.path.exists(html_path) else None 23 | opener = urllib2.build_opener() 24 | opener.addheaders = [('Referer', 'https://arxiv.org/format/{}'.format(arxiv_id)), ('User-Agent', 'Mozilla/5.0')] 25 | page = opener.open("https://arxiv.org/e-print/{}".format(arxiv_id)) 26 | meta = page.info() 27 | file_size = meta.getheaders("Content-Length")[0] 28 | if (int(file_size) / 1024. / 1024. > 15): 29 | # File too big 30 | os.mkdir(src_path) 31 | return None 32 | print("download {}: {}".format(arxiv_id, file_size)) 33 | data = page.read() 34 | os.mkdir(src_path) 35 | tgz_path = "{}/source.tgz".format(src_path) 36 | open(tgz_path, "wb").write(data) 37 | os.chdir(src_path) 38 | os.system("tar xzf {} --directory {}".format(tgz_path, src_path)) 39 | texfiles = [fn for fn in os.listdir(src_path) if fn.endswith(".tex")] 40 | if texfiles: 41 | select_texfile = texfiles[0] 42 | if len(texfiles) > 1: 43 | for fn in texfiles: 44 | text = open("{}/{}".format(src_path, fn)).read() 45 | if "begin{document}" in text: 46 | select_texfile = fn 47 | break 48 | cmd = "latexml --includestyles --dest=main.xml {}".format(select_texfile.replace(".tex", "")) 49 | execute_with_timeout(cmd) 50 | execute_with_timeout("latexmlpost --dest=main.html main.xml") 51 | execute_with_timeout("latexmlpost --dest=main.html main.xml") 52 | os.remove(tgz_path) 53 | open("{}/.loaded".format(src_path), "wb").write("loaded") 54 | return html_path if os.path.exists(html_path) else None 55 | 56 | def retrieve_paper_html(arxiv_token): 57 | src_path = "{}/{}".format(settings.SOURCE_PATH, arxiv_token) 58 | html_path = "{}/main.html".format(src_path) 59 | if os.path.exists(src_path) and not os.path.exists("{}/.loaded".format(src_path)): 60 | html_body = "PROCESSING" 61 | elif os.path.exists(src_path) and not os.path.exists(html_path): 62 | html_body = "NOT_AVAILABE" 63 | elif os.path.exists(src_path) and os.path.exists(html_path): 64 | html_body = open(html_path).read().decode("utf-8") 65 | html_body = html_body.split("")[-1] 66 | html_body = html_body.split("")[0] 67 | html_body = html_body.replace('= since) 62 | if not keywords or keywords.lower() == 'fresh papers': 63 | # Recent papers 64 | results = (query.order_by(desc(ArxivModel.published_time)) 65 | .offset(start).limit(num).all()) 66 | elif keywords.lower() == 'hot papers': 67 | results = (query.order_by(desc(ArxivModel.popularity)) 68 | .offset(start).limit(num).all()) 69 | else: 70 | # search_kw = " or ".join(["({})".format(x) for x in keywords.split(",")]) 71 | search_kw = " or ".join(keywords.split(",")) 72 | searched_query = search(query, search_kw, sort=True) 73 | results = searched_query.offset(start).limit(num).all() 74 | return results 75 | 76 | def fetch_new(self): 77 | from ..db import session_scope, ArxivModel 78 | with session_scope() as session: 79 | for i in range(0, MAX_QUERY_NUM, 100): 80 | logging.info("get paper starting from {}".format(i)) 81 | results = query_arxiv(start=i) 82 | anything_new = False 83 | for result in results: 84 | arxiv_url = result["arxiv_url"] 85 | if session.query(ArxivModel).filter_by(arxiv_url=arxiv_url).count() == 0: 86 | anything_new = True 87 | new_paper = ArxivModel( 88 | arxiv_url=arxiv_url, 89 | version=self._get_version(arxiv_url), 90 | title=result["title"].replace("\n", "").replace(" ", " "), 91 | abstract=result["summary"].replace("\n", "").replace(" ", " "), 92 | pdf_url=result["pdf_url"], 93 | authors=", ".join(result["authors"])[:800], 94 | published_time=datetime.fromtimestamp(mktime(result["updated_parsed"])), 95 | journal_link=result["journal_reference"], 96 | tag=" | ".join([x["term"] for x in result["tags"]]), 97 | popularity=0 98 | ) 99 | session.add(new_paper) 100 | session.commit() 101 | if not anything_new: 102 | break 103 | time.sleep(3) 104 | -------------------------------------------------------------------------------- /dlmonitor/sources/base.py: -------------------------------------------------------------------------------- 1 | """ 2 | Base class of all sources. 3 | """ 4 | 5 | from abc import ABCMeta, abstractmethod 6 | 7 | class Source(object): 8 | 9 | __metaclass__ = ABCMeta 10 | 11 | def get_posts(self, keywords=None, since=None, start=0, num=100): 12 | """ 13 | Get recent posts. 14 | """ 15 | return [] 16 | 17 | @abstractmethod 18 | def fetch_new(self): 19 | """ 20 | Fetch new resources. 21 | """ 22 | 23 | def fetch_all(self): 24 | """ 25 | Fetch a ton of resources to initialize the databse. 26 | If this function is not implementated, well, just fetch new ones. 27 | """ 28 | fetch_new() 29 | -------------------------------------------------------------------------------- /dlmonitor/sources/twittersrc.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | import re 3 | from base import Source 4 | from sqlalchemy_searchable import search 5 | from sqlalchemy import desc 6 | from ..settings import PROJECT_ROOT, TWITTER_ACCESS_TOKEN, TWITTER_CONSUMER_KEY, TWITTER_ACCESS_SECRET, TWITTER_CONSUMER_SECRET 7 | import time 8 | from time import mktime 9 | from datetime import datetime 10 | import logging 11 | import twitter 12 | from six.moves.html_parser import HTMLParser 13 | 14 | TW_DATA_PATH = "{}/data/twitter_watching_list.txt".format(PROJECT_ROOT) 15 | 16 | class TwitterSource(Source): 17 | 18 | def get_posts(self, keywords=None, since=None, start=0, num=30): 19 | from ..db import get_global_session, TwitterModel 20 | if keywords: 21 | keywords = keywords.strip() 22 | session = get_global_session() 23 | query = session.query(TwitterModel) 24 | if since: 25 | # Filter date 26 | assert isinstance(since, str) 27 | query = query.filter(TwitterModel.published_time >= since) 28 | if not keywords or keywords.lower() == 'fresh tweets': 29 | # Recent papers 30 | results = (query.order_by(desc(TwitterModel.published_time)) 31 | .offset(start).limit(num).all()) 32 | elif keywords.lower() == 'hot tweets': 33 | results = (query.order_by(desc(TwitterModel.popularity)) 34 | .offset(start).limit(num).all()) 35 | else: 36 | search_kw = " or ".join(keywords.split(",")) 37 | searched_query = search(query, search_kw, sort=True) 38 | results = searched_query.offset(start).limit(num).all() 39 | 40 | # Unescape HTML 41 | parser = HTMLParser() 42 | for result in results: 43 | matches = re.findall(r"(https://t\.co/[^ .]{10})", result.text) 44 | result.href_text = result.text 45 | try: 46 | for match in matches: 47 | result.href_text = result.href_text.replace(match, '{}'.format(match, match)) 48 | except: 49 | pass 50 | return results 51 | 52 | def _extract_arxiv_url(self, url): 53 | arxiv_url = url.replace("/pdf/", "/abs/") 54 | arxiv_url = arxiv_url.replace(".pdf", "") 55 | arxiv_url = arxiv_url.replace("https:", "http:") 56 | if "v" not in arxiv_url.split("/")[-1]: 57 | arxiv_url += "v1" 58 | return arxiv_url 59 | 60 | def fetch_new(self): 61 | from ..db import session_scope, TwitterModel, ArxivModel 62 | tw = twitter.Api(consumer_key=TWITTER_CONSUMER_KEY, consumer_secret=TWITTER_CONSUMER_SECRET, 63 | access_token_key=TWITTER_ACCESS_TOKEN, access_token_secret=TWITTER_ACCESS_SECRET) 64 | with session_scope() as session: 65 | tw_watch_list = map(str.strip, open(TW_DATA_PATH).readlines()) 66 | for tw_name in tw_watch_list: 67 | logging.info("get tweets from {}".format(tw_name)) 68 | if tw_name.startswith("@"): 69 | screen_name = tw_name.replace("@", "") 70 | posts = tw.GetUserTimeline(screen_name=screen_name, count=200) 71 | else: 72 | posts = tw.GetSearch(term=tw_name, result_type='mixed', count=200) 73 | for post in posts: 74 | tweet_id = post.id_str 75 | if session.query(TwitterModel).filter_by(tweet_id=tweet_id).count() == 0: 76 | pic_url = None 77 | if post.media: 78 | for media in post.media: 79 | if media.type == 'photo': 80 | pic_url = media.media_url_https 81 | break 82 | new_tweet = TwitterModel( 83 | tweet_id=tweet_id, 84 | user=post.user.screen_name, 85 | text=post.text, 86 | published_time=post.created_at, 87 | popularity=post.favorite_count, 88 | pic_url=pic_url 89 | ) 90 | session.add(new_tweet) 91 | # Update arxiv paper popularity 92 | for url in post.urls: 93 | if "arxiv.org" in url.expanded_url: 94 | arxiv_url = self._extract_arxiv_url(url.expanded_url) 95 | affected_count = session.query(ArxivModel).filter_by(arxiv_url=arxiv_url).update( 96 | {"popularity": ArxivModel.popularity + 1 + post.favorite_count}) 97 | if affected_count == 0: 98 | print ("[WARN] Paper is not found: {}".format(arxiv_url)) 99 | else: 100 | # Update popularity of this tweet and related arxiv post 101 | tweet = session.query(TwitterModel).filter_by(tweet_id=tweet_id).first() 102 | if tweet is not None: 103 | if post.favorite_count > tweet.popularity: 104 | tweet.popularity = post.favorite_count 105 | for url in post.urls: 106 | if "arxiv.org" in url.expanded_url: 107 | arxiv_url = self._extract_arxiv_url(url.expanded_url) 108 | print ("Update popularity of {}".format(arxiv_url)) 109 | paper = session.query(ArxivModel).filter_by(arxiv_url=arxiv_url).first() 110 | if paper: 111 | paper.popularity += post.favorite_count - tweet.popularity 112 | session.commit() 113 | time.sleep(1) 114 | -------------------------------------------------------------------------------- /dlmonitor/webapp/__init__.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | -------------------------------------------------------------------------------- /dlmonitor/webapp/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | from flask import Flask, request, redirect, session, send_from_directory 3 | from flask import render_template, send_from_directory 4 | from dlmonitor.db import close_global_session, get_global_session 5 | from dlmonitor.fetcher import get_posts 6 | from dlmonitor import settings 7 | from urllib2 import unquote 8 | import datetime as DT 9 | 10 | from mendeley import Mendeley 11 | from mendeley.session import MendeleySession 12 | import oauthlib 13 | 14 | 15 | 16 | app = Flask(__name__, static_url_path='/static') 17 | app.secret_key = settings.SESSION_KEY 18 | app.config['SESSION_TYPE'] = 'filesystem' 19 | 20 | 21 | NUMBER_EACH_PAGE = 30 22 | DEFAULT_KEYWORDS = "Hot Tweets,Hot Papers,Fresh Papers,reinforcement learning,language" 23 | DATE_TOKEN_SET = set(['1-week', '2-week', '1-month']) 24 | 25 | # Mendeley 26 | MENDELEY_REDIRECT = "{}/oauth".format(settings.HOME_URL) 27 | mendeley = Mendeley(settings.MENDELEY_CLIENTID, settings.MENDELEY_SECRET, MENDELEY_REDIRECT) 28 | 29 | def get_date_str(token): 30 | """ 31 | Convert token to date string. 32 | For example, '1-week' ---> '2017-04-03'. 33 | """ 34 | today = DT.date.today() 35 | if token not in DATE_TOKEN_SET: 36 | token = '2-week' 37 | if token == '1-week': 38 | target_date = today - DT.timedelta(days=7) 39 | elif token == '2-week': 40 | target_date = today - DT.timedelta(days=14) 41 | else: 42 | target_date = today - DT.timedelta(days=31) 43 | return target_date.strftime("%Y-%m-%d") 44 | 45 | @app.route('/') 46 | def index(): 47 | keywords = request.cookies.get('keywords') 48 | if not keywords: 49 | keywords = DEFAULT_KEYWORDS 50 | else: 51 | keywords = unquote(keywords) 52 | target_date = get_date_str(request.cookies.get('datetoken')) 53 | column_list = [] 54 | for kw in keywords.split(","): 55 | src = "twitter" if "tweets" in kw.lower() else "arxiv" 56 | num_page = 80 if src == "twitter" else NUMBER_EACH_PAGE 57 | posts = get_posts(src, keywords=kw, since=target_date, start=0, num=num_page) 58 | column_list.append((src, kw, posts)) 59 | 60 | # Mendeley 61 | auth = mendeley.start_authorization_code_flow() 62 | if "ma_token" in session and session["ma_token"] is not None: 63 | ma_session = MendeleySession(mendeley, session['ma_token']) 64 | try: 65 | ma_firstname = ma_session.profiles.me.first_name 66 | except: 67 | session['ma_token'] = None 68 | ma_session =None 69 | ma_firstname = None 70 | else: 71 | ma_session = None 72 | ma_firstname = None 73 | 74 | ma_authorized = ma_session is not None and ma_session.authorized 75 | return render_template( 76 | "index.html", columns=column_list, mendeley_login=auth.get_login_url(), 77 | ma_session=ma_session, ma_authorized=ma_authorized, ma_firstname=ma_firstname 78 | ) 79 | 80 | @app.route('/fetch', methods=['POST']) 81 | def fetch(): 82 | # Get keywords 83 | kw = request.form.get('keyword') 84 | if kw is not None: 85 | kw = unquote(kw) 86 | # Get parameters 87 | src = request.form.get("src") 88 | start = request.form.get("start") 89 | if src is None or start is None: 90 | # Error if 'src' or 'start' parameter is not found 91 | return "" 92 | assert "." not in src # Just for security 93 | start = int(start) 94 | # Get target date string 95 | target_date = get_date_str(request.cookies.get('datetoken')) 96 | 97 | num_page = 80 if src == "twitter" else NUMBER_EACH_PAGE 98 | 99 | # Mendeley 100 | ma_authorized = "ma_token" in session and session["ma_token"] is not None 101 | 102 | return render_template( 103 | "post_{}.html".format(src), 104 | posts=get_posts(src, keywords=kw, since=target_date, start=start, num=num_page), 105 | ma_authorized=ma_authorized) 106 | 107 | @app.route("/arxiv//") 108 | def arxiv(arxiv_id, paper_str): 109 | from dlmonitor.sources.arxivsrc import ArxivSource 110 | from dlmonitor.latex import retrieve_paper_html 111 | post = ArxivSource().get_one_post(arxiv_id) 112 | arxiv_token = post.arxiv_url.split("/")[-1] 113 | 114 | # Check the HTML page 115 | html_body = retrieve_paper_html(arxiv_token) 116 | return render_template("single.html", 117 | post=post, arxiv_token=arxiv_token, html_body=html_body) 118 | 119 | @app.route("/about") 120 | def about(): 121 | return render_template("about.html") 122 | 123 | @app.route("/search") 124 | def search(): 125 | return render_template("search.html") 126 | 127 | @app.route('/oauth') 128 | def auth_return(): 129 | auth = mendeley.start_authorization_code_flow(state=request.args.get("state")) 130 | mendeley_session = auth.authenticate(request.url) 131 | 132 | session["ma_token"] = mendeley_session.token 133 | session["ma_state"] = request.args.get("state") 134 | 135 | return redirect('/') 136 | 137 | @app.route("/save_mendeley") 138 | def save_mendeley(): 139 | import urllib 140 | if "ma_token" in session and session["ma_token"] is not None: 141 | ma_session = MendeleySession(mendeley, session['ma_token']) 142 | else: 143 | ma_session = None 144 | 145 | ma_authorized = ma_session is not None and ma_session.authorized 146 | if not ma_authorized: 147 | return "Please log in into Mendeley." 148 | 149 | pdf_url = request.args.get('url') 150 | # Retrieve pdf file 151 | arxiv_id = pdf_url.split("/")[-1].replace(".pdf", "") 152 | local_pdf = "{}/{}.pdf".format(settings.PDF_PATH, arxiv_id) 153 | remote_pdf = "http://arxiv.org/pdf/{}.pdf".format(arxiv_id) 154 | if not os.path.exists(local_pdf): 155 | urllib.urlretrieve(remote_pdf, local_pdf) 156 | 157 | # Create file 158 | ma_session.documents.create_from_file(local_pdf) 159 | 160 | return "{} is saved into Mendeley".format(os.path.basename(local_pdf)) 161 | 162 | @app.route("/load_fulltext/") 163 | def load_fulltext(arxiv_token): 164 | from dlmonitor.db_models import WorkingQueueModel 165 | db_session = get_global_session() 166 | job = WorkingQueueModel( 167 | type="load_arxiv", 168 | param=arxiv_token 169 | ) 170 | db_session.add(job) 171 | db_session.commit() 172 | return "OK" 173 | 174 | @app.route("/retrieve_fulltext/") 175 | def retrieve_fulltext(arxiv_token): 176 | from dlmonitor.latex import retrieve_paper_html 177 | return retrieve_paper_html(arxiv_token) 178 | 179 | @app.route("/arxiv_files//") 180 | def arxiv_files(arxiv_token, fp): 181 | fp = "{}/{}/{}".format(settings.SOURCE_PATH, arxiv_token, fp) 182 | if os.path.exists(fp): 183 | return send_from_directory(os.path.dirname(fp), os.path.basename(fp)) 184 | else: 185 | return "" 186 | 187 | @app.route("/logout") 188 | def logout(): 189 | session["ma_token"] = None 190 | return redirect("/") 191 | 192 | if __name__ == '__main__': 193 | # app.run(host='0.0.0.0', debug=True, ssl_context='adhoc') 194 | app.run(host='0.0.0.0', debug=True) 195 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/LaTeXML.css: -------------------------------------------------------------------------------- 1 | /*====================================================================== 2 | Core CSS for LaTeXML documents converted to (X)HTML */ 3 | /* Generic Page layout */ 4 | .ltx_page_header, 5 | .ltx_page_footer { font-size:0.8em; } 6 | .ltx_page_header *[rel~="prev"], 7 | .ltx_page_footer *[rel~="prev"] { float:left; } 8 | .ltx_page_header *[rel~="up"], 9 | .ltx_page_footer *[rel~="up"] { display:block; text-align:center; } 10 | .ltx_page_header *[rel~="next"], 11 | .ltx_page_footer *[rel~="next"] { float:right; } 12 | /* What was I trying for here; need more selective rule! 13 | .ltx_page_header .ltx_ref, 14 | .ltx_page_footer .ltx_ref { 15 | margin:0 1em; } 16 | */ 17 | .ltx_page_header li { 18 | padding:0.1em 0.2em 0.1em 1em;} 19 | 20 | /* Main content */ 21 | .ltx_page_content { clear:both; } 22 | .ltx_page_header { border-bottom:1px solid; margin-bottom:5px; } 23 | .ltx_page_footer { clear:both; border-top:1px solid; margin-top:5px; } 24 | 25 | .ltx_page_header:after, 26 | .ltx_page_footer:after, 27 | .ltx_page_content:after { content:"."; display:block; height:0; clear:both; visibility:hidden; } 28 | 29 | .ltx_page_footer:before 30 | { content:"."; display:block; height:0; clear:both; visibility:hidden; } 31 | 32 | .ltx_page_logo { font-size:80%; margin-top: 5px; clear:both; float:right; } 33 | .ltx_page_logo a { font-variant: small-caps; } 34 | .ltx_page_logo img { vertical-align:-3px; } 35 | 36 | /* if shown */ 37 | .ltx_page_navbar li { white-space:nowrap; display:block; overflow:hidden; } 38 | /* If ref got turned into span, it's "this section"*/ 39 | .ltx_page_navbar li span.ltx_ref { white-space:normal; overflow:visible; } 40 | 41 | /* Ought to be easily removable/overridable? */ 42 | .ltx_pagination.ltx_role_newpage { height:2em; } 43 | /*====================================================================== 44 | Document Structure; Titles & Frontmatter */ 45 | 46 | /* undo bold here to remove the browser's native h# styling, 47 | at let all other styles override it (with more specific rules)*/ 48 | .ltx_title { font-size:100%; font-weight:normal; } 49 | 50 | /* Hack to simulate run-in! put class="ltx_runin" on a title or tag 51 | for it to run-into the following text. */ 52 | .ltx_runin { display:inline; } 53 | .ltx_runin:after { content:" "; } 54 | .ltx_runin + .ltx_para, 55 | .ltx_runin + .ltx_para p, 56 | .ltx_runin + p { display:inline; } 57 | 58 | .ltx_outdent { margin-left: -2em; } 59 | 60 | /* .ltx_chapter_title, etc should be in ltx-article.css etc. 61 | */ 62 | .ltx_page_main { margin:0px; } 63 | .ltx_tocentry { list-style-type:none; } 64 | 65 | /* support for common author block layouts.*/ 66 | /* add class ltx_authors_1line to get authors in single line 67 | with pop-up affiliation, etc. */ 68 | .ltx_authors_1line .ltx_creator, 69 | .ltx_authors_1line .ltx_author_before, 70 | .ltx_authors_1line .ltx_author_after { display:inline;} 71 | .ltx_authors_1line .ltx_author_notes { display:inline-block; } 72 | .ltx_authors_1line .ltx_author_notes:before { content:"*"; color:blue;} 73 | .ltx_authors_1line .ltx_author_notes span { display:none; } 74 | .ltx_authors_1line .ltx_author_notes:hover span { 75 | display:block; position:absolute; z-index:10; 76 | background:#E0E0E0; border:3px outset gray; 77 | text-align:left; } 78 | 79 | /* add class=ltx_authors_multiline to get authors & affliations on separate lines*/ 80 | .ltx_authors_multiline .ltx_creator, 81 | .ltx_authors_multiline .ltx_author_before, 82 | .ltx_authors_multiline .ltx_author_after, 83 | .ltx_authors_multiline .ltx_author_notes, 84 | .ltx_authors_multiline .ltx_author_notes .ltx_contact { 85 | display:block; } 86 | 87 | 88 | /*====================================================================== 89 | Para level */ 90 | td.ltx_subfigure, 91 | td.ltx_subtable, 92 | td.ltx_subfloat { width:50%; } 93 | /* theorems, figure, tables, floats captions.. */ 94 | /*====================================================================== 95 | Blocks, Lists, Floats */ 96 | .ltx_p, 97 | .ltx_quote, 98 | .ltx_block, 99 | .ltx_listingblock, 100 | .ltx_para 101 | { display: block; } 102 | 103 | .ltx_align_left {text-align:left; } 104 | .ltx_align_right {text-align:right; } 105 | .ltx_align_center {text-align:center; } 106 | .ltx_align_justify {text-align:justify; } 107 | .ltx_align_top {vertical-align:top; } 108 | .ltx_align_bottom {vertical-align:bottom; } 109 | .ltx_align_middle {vertical-align:middle; } 110 | .ltx_align_baseline {vertical-align:baseline; } 111 | 112 | .ltx_align_floatleft { float:left; } 113 | .ltx_align_floatright { float:right; } 114 | 115 | td.ltx_align_left, th.ltx_align_left, 116 | td.ltx_align_right, th.ltx_align_right, 117 | td.ltx_align_center, th.ltx_align_center { white-space:nowrap; } 118 | 119 | .ltx_inline-block { display:inline-block; } 120 | div.ltx_equation { display:block; width:95%; text-align:center; } 121 | /*.ltx_equation span.ltx_refnum.ltx_left { position:absolute; left:2em; } 122 | .ltx_equation span.ltx_refnum.ltx_right { position:absolute; right:2em; } 123 | */ 124 | .ltx_tag_equation.ltx_align_left { position:absolute; left:3em; } 125 | .ltx_tag_equation.ltx_align_right { position:absolute; right:3em; } 126 | 127 | .ltx_equation td { width:auto; } 128 | table.ltx_equation, 129 | table.ltx_equationgroup { width:100%; } 130 | table.ltx_eqn_align tr.ltx_equation td.ltx_align_left + td.ltx_align_right { padding-left:3em; } 131 | table.ltx_eqn_eqnarray tr.ltx_eqn_lefteqn + tr td.ltx_align_right { min-width:2em; } 132 | td.ltx_eqn_eqno { max-width:0em; overflow:visible; } 133 | td.ltx_eqn_eqno.ltx_align_right .ltx_tag { float:right; } 134 | 135 | /* Hide this from IE */ 136 | tr > td.ltx_eqn_center_padleft, 137 | tr > td.ltx_eqn_center_padright { width:50%; } 138 | tr > td.ltx_eqn_left_padleft, 139 | tr > td.ltx_eqn_right_padright { min-width:2em; } 140 | tr > td.ltx_eqn_left_padright, 141 | tr > td.ltx_eqn_right_padleft { width:100%; } 142 | 143 | .ltx_itemize, 144 | .ltx_enumerate, 145 | .ltx_description 146 | { display:block; } 147 | .ltx_itemize .ltx_item, 148 | .ltx_enumerate .ltx_item 149 | { display: list-item; } 150 | 151 | /* Position the tag to look like a normal item bullet. */ 152 | li.ltx_item > .ltx_tag { 153 | display:inline-block; margin-left:-1.5em; min-width:1.5em; 154 | text-align:right; } 155 | .ltx_item .ltx_tag + .ltx_para, 156 | .ltx_item .ltx_tag + .ltx_para .ltx_p { display:inline; } 157 | 158 | /* NOTE: Need to try harder to get runin appearance? */ 159 | dl.ltx_description dt { margin-right:0.5em; float:left; 160 | font-weight:bold; font-size:95%; } 161 | dl.ltx_description dd { margin-left:5em; } 162 | dl.ltx_description dl.ltx_description dd { margin-left:3em; } 163 | 164 | .ltx_theorem {margin:1em 0em 1em 0em; } 165 | .ltx_title_theorem { font-size:100%; } 166 | .ltx_bibliography dt { margin-right:0.5em; float:left; } 167 | .ltx_bibliography dd { margin-left:3em; } 168 | /*.ltx_biblist { list-style-type:none; }*/ 169 | .ltx_bibitem { list-style-type:none; } 170 | .ltx_bibtag { font-weight:bold; margin-left:-2em; width:3em; } 171 | /*.bibitem-tag + div { display:inline; }*/ 172 | .ltx_bib_title { font-style:italic; } 173 | .ltx_bib_article .bib-title { font-style:normal !important; } 174 | .ltx_bib_journal { font-style:italic; } 175 | .ltx_bib_volume { font-weight:bold; } 176 | 177 | .ltx_indexlist li { list-style-type:none; } 178 | .ltx_indexlist { margin-left:1em; padding-left:1em;} 179 | .ltx_listing td.ltx_linenumber, 180 | .ltx_listingblock td.ltx_linenumber 181 | { width:3em; text-align:right;} 182 | 183 | .ltx_parbox {text-indent:0em; } 184 | 185 | /* NOTE that it is CRITICAL to put position:relative outside & absolute inside!! 186 | I wish I understood why! 187 | Outer box establishes resulting size, neutralizes any outer positioning, etc; 188 | inner establishes position of stuff to be rotated */ 189 | .ltx_transformed_outer { 190 | position:relative; top:0pt;left:0pt; 191 | overflow:visible; } 192 | .ltx_transformed_inner { 193 | display:block; 194 | position:absolute;top:0pt;left:0pt; } 195 | .ltx_transformed_inner > .ltx_p {text-indent:0em; margin:0; padding:0; } 196 | 197 | /* by default, p doesn't indent */ 198 | .ltx_p { text-indent:0em; white-space:normal; } 199 | /* explicit control of indentation (on ltx_para) */ 200 | .ltx_indent > .ltx_p:first-child { text-indent:2em!important; } 201 | .ltx_noindent > .ltx_p:first-child { text-indent:0em!important; } 202 | 203 | /*====================================================================== 204 | Columns */ 205 | .ltx_page_column1 { 206 | width:44%; float:left; } /* IE uses % of wrong container*/ 207 | .ltx_page_column2 { 208 | width:44%; float:right; } 209 | .ltx_page_columns > .ltx_page_column1 { 210 | width:48%; float:left; } 211 | .ltx_page_columns > .ltx_page_column2 { 212 | width:48%; float:right; } 213 | .ltx_page_columns:after { 214 | content:"."; display:block; height:0; clear:both; visibility:hidden; } 215 | 216 | /*====================================================================== 217 | Borders and such */ 218 | .ltx_tabular { display:table; border-collapse:collapse; } 219 | span.ltx_tabular { display:inline-table; border-collapse:collapse; } 220 | .ltx_thead, 221 | .ltx_tbody { display:table-row-group; } 222 | .ltx_tr { display:table-row; } 223 | .ltx_td { display:table-cell; } 224 | 225 | .ltx_framed { border:1px solid black;} 226 | .ltx_tabular td, .ltx_tabular th { padding:0.1em 0.5em; } 227 | .ltx_border_t { border-top:1px solid black; } 228 | .ltx_border_r { border-right:1px solid black; } 229 | .ltx_border_b { border-bottom:1px solid black; } 230 | .ltx_border_l { border-left:1px solid black; } 231 | .ltx_border_tt { border-top:3px double black; } 232 | .ltx_border_rr { border-right:3px double black; } 233 | .ltx_border_bb { border-bottom:3px double black; } 234 | .ltx_border_ll { border-left:3px double black; } 235 | 236 | /*====================================================================== 237 | Misc */ 238 | /* .ltx_verbatim*/ 239 | .ltx_verbatim { text-align:left; } 240 | /*====================================================================== 241 | Meta stuff, footnotes */ 242 | .ltx_note_content { display:none; } 243 | /*right:5%; */ 244 | .ltx_note_content { 245 | max-width: 70%; font-size:80%; left:15%; 246 | text-align:left; 247 | background:#E0E0E0; border:3px outset gray; } 248 | .ltx_note_mark { color:blue; } 249 | .ltx_note_type { font-weight: bold; } 250 | .ltx_note { display:inline-block; text-indent:0; } /* So we establish containing block */ 251 | .ltx_note:hover .ltx_note_content 252 | { display:block; position:absolute; z-index:10; } 253 | 254 | .ltx_ERROR { color:red; } 255 | .ltx_rdf { display:none; } 256 | 257 | /*====================================================================== 258 | SVG (pgf/tikz ?) basics */ 259 | 260 | /* Stuff appearing in svg:foreignObject */ 261 | .ltx_svg_fog foreignObject { margin:0; padding:0; overflow:visible; } 262 | .ltx_svg_fog foreignObject > p { margin:0; padding:0; display:block; } 263 | /*.ltx_svg_fog foreignObject > p { margin:0; padding:0; display:block; white-space:nowrap; }*/ 264 | 265 | /*====================================================================== 266 | Low-level Basics */ 267 | .ltx_font_serif { font-family: serif; } 268 | .ltx_font_sansserif { font-family: sans-serif; } 269 | .ltx_font_typewriter { font-family: monospace; } 270 | .ltx_font_bold { font-weight: bold; } 271 | .ltx_font_medium { font-weight: normal; } 272 | .ltx_font_italic { font-style: italic; } 273 | .ltx_font_upright { font-style: normal; } 274 | .ltx_font_slanted { font-style: oblique; } 275 | .ltx_font_smallcaps { font-variant: small-caps; } 276 | .ltx_font_oldstyle { font-variant: oldstyle-nums; /* experimental css3 ? Doesn't seem to work!*/ 277 | -moz-font-feature-settings: "onum"; 278 | -ms-font-feature-settings: "onum"; 279 | -webkit-font-feature-settings: "onum"; 280 | font-variant-numeric: oldstyle-nums; } 281 | .ltx_font_mathcaligraphic { font-family: "Lucida Calligraphy", "Zapf Chancery","URW Chancery L"; } 282 | /* 283 | 284 | .ltx_font_mathscript { ? } 285 | */ 286 | cite { font-style: normal; } 287 | 288 | .ltx_red { color:red; } 289 | /*.ltx_centering { text-align:center; margin:auto; }*/ 290 | /*.ltx_inline-block.ltx_centering,*/ 291 | /* Hmm.... is this right in general? */ 292 | .ltx_centering { display:block; margin:auto; text-align:center; } 293 | table.ltx_centering { display:table; } /*!!! */ 294 | 295 | /* .ltx_phantom handled in xslt */ 296 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | Javascript for Deep Community. 3 | */ 4 | 5 | INIT_KEYWORDS = "Hot Tweets,Hot Papers,Fresh Papers,reinforcement learning,language"; 6 | 7 | dlmonitor = { 8 | ajaxCount: 0, 9 | previewTimeout: null, 10 | }; 11 | 12 | dlmonitor.getKeywords = function() { 13 | var keywords = Cookies.get('keywords'); 14 | if (Cookies.get('keywords') == undefined) { 15 | keywords = INIT_KEYWORDS; 16 | } 17 | if (!keywords) { 18 | var kwList = []; 19 | } else { 20 | var kwList = keywords.split(","); 21 | } 22 | return kwList; 23 | }; 24 | 25 | // This requires js-cookie 26 | dlmonitor.addKeyword = function(w) { 27 | if (w == undefined || typeof(w) == "object" || !w) { 28 | w = $("#new-keyword").val() 29 | } 30 | if (w.length == 0) { 31 | return; 32 | } 33 | if (w.includes(",")) { 34 | alert("Keyword can not include comma."); 35 | return; 36 | } 37 | if (w.length > 80) { 38 | alert("Keyword can not longer than 80 chars.") 39 | return; 40 | } 41 | $("#new-keyword").val("") 42 | var kwList = dlmonitor.getKeywords(); 43 | if (kwList.length > 10) { 44 | alert("No more than 10 keywords, please."); 45 | return; 46 | } 47 | kwList.push(w.trim()); 48 | var newKeywords = kwList.join(","); 49 | Cookies.set("keywords", newKeywords); 50 | // dlmonitor.showKeywords(); 51 | dlmonitor.switchPreview(false); 52 | dlmonitor.updateAll(); 53 | }; 54 | 55 | dlmonitor.moveKeyword = function(e, dir) { 56 | var kwList = dlmonitor.getKeywords(); 57 | var pos = $(e).data('pos'); 58 | if ((pos == 0 && dir < 0) || (pos >= kwList.length - 1 && dir > 0)) { 59 | return; 60 | } 61 | var swapIdx = pos + dir; 62 | var swap = kwList[swapIdx]; 63 | kwList[swapIdx] = kwList[pos]; 64 | kwList[pos] = swap; 65 | console.log(pos,dir); 66 | var newKeywords = kwList.join(","); 67 | Cookies.set("keywords", newKeywords); 68 | dlmonitor.updateAll(); 69 | }; 70 | 71 | dlmonitor.removeKeyword = function(e) { 72 | var w = $(e).data('keyword'); 73 | if (w == undefined) { 74 | return; 75 | } 76 | var kwList = dlmonitor.getKeywords(); 77 | var index = kwList.indexOf(w); 78 | if (index > -1) { 79 | kwList.splice(index, 1); 80 | } 81 | var newKeywords = kwList.join(","); 82 | Cookies.set("keywords", newKeywords); 83 | dlmonitor.showKeywords(); 84 | dlmonitor.updateAll(); 85 | }; 86 | 87 | // Deprecated 88 | dlmonitor.showKeywords = function() { 89 | var newHtml = ""; 90 | var kwList = dlmonitor.getKeywords(); 91 | kwList.forEach(function(kw){ 92 | newHtml += '' + kw + ''; 93 | }); 94 | $("#keywords").html(newHtml); 95 | }; 96 | 97 | dlmonitor.fetch = function(src_name, keyword, index, start) { 98 | if (start == undefined) start = 0; 99 | console.log("fetch", src_name, keyword, index, start); 100 | $("#posts-" + index).html( 101 | "
"+ 102 | ""+ 103 | "
"); 104 | dlmonitor.ajaxCount ++; 105 | $.ajax({ 106 | url: '/fetch', 107 | type: 'POST', 108 | data: { 109 | src: src_name, 110 | start: "" + start, 111 | keyword: keyword 112 | }, 113 | error: function() { 114 | dlmonitor.ajaxCount --; 115 | alert("Error when fetching data."); 116 | }, 117 | success: function(data) { 118 | // console.log(data); 119 | dlmonitor.ajaxCount --; 120 | $("#posts-" + index).html(data); 121 | } 122 | }); 123 | }; 124 | 125 | dlmonitor.convertDateInfo = function(token) { 126 | var dateinfo = "Recent two weeks"; 127 | switch (token) { 128 | case '1-week': 129 | dateinfo = "Recent one week"; 130 | break; 131 | case '2-week': 132 | dateinfo = "Recent two weeks"; 133 | break; 134 | case '1-month': 135 | dateinfo = "Recent one month"; 136 | break; 137 | } 138 | return dateinfo; 139 | }; 140 | 141 | dlmonitor.showDate = function() { 142 | var datetoken = Cookies.get('datetoken'); 143 | if (!datetoken) { 144 | datetoken = '2-week'; 145 | } 146 | $("#date-info").html(dlmonitor.convertDateInfo(datetoken)); 147 | }; 148 | 149 | dlmonitor.filterDate = function(token) { 150 | Cookies.set('datetoken', token); 151 | dlmonitor.updateAll(); 152 | }; 153 | 154 | dlmonitor.placeColumns = function() { 155 | var kwList = dlmonitor.getKeywords(); 156 | var currentNum = $(".post-columns .column").length 157 | // Create columns 158 | if (kwList.length != currentNum) { 159 | var newHtml = ""; 160 | for (var i = 0; i < kwList.length; ++i) { 161 | var template = $("#column-template").html() 162 | for (var j = 0; j < 6; ++j) { 163 | template = template.replace("NUM", "" + i); 164 | } 165 | newHtml += template; 166 | } 167 | $("#post-columns").html(newHtml); 168 | } 169 | // Fill titles 170 | for (var i = 0; i < kwList.length; ++i) { 171 | $("#column-title-" + i).html(kwList[i]); 172 | $("#close-btn-" + i).data("keyword", kwList[i]) 173 | $("#left-btn-" + i).data("pos", i) 174 | $("#right-btn-" + i).data("pos", i) 175 | } 176 | }; 177 | 178 | // Deprecated 179 | dlmonitor.fixFloat = function() { 180 | if (dlmonitor.ajaxCount != 0) return; 181 | var threshold = $("#post-columns").position().left + 1200 / 2; 182 | $(".post-columns .column").each(function(i, e) { 183 | if ($(e).position().left > threshold) { 184 | $(e).css("float", "right"); 185 | } 186 | }); 187 | }; 188 | 189 | dlmonitor.updateAll = function(nofetch) { 190 | dlmonitor.showDate(); 191 | dlmonitor.placeColumns(); 192 | if (nofetch == true) return; 193 | var kwList = dlmonitor.getKeywords(); 194 | for (var i = 0; i < kwList.length; ++i) { 195 | if (kwList[i].toLowerCase().includes("tweets")) { 196 | var src = 'twitter'; 197 | } else { 198 | var src = 'arxiv'; 199 | } 200 | dlmonitor.fetch(src, kwList[i], i, start=0); 201 | } 202 | }; 203 | 204 | dlmonitor.switchPreview = function(flag) { 205 | if (flag) { 206 | $(".preview").show(); 207 | $(".post-columns").hide(); 208 | } else { 209 | $(".preview").hide(); 210 | $(".post-columns").show(); 211 | } 212 | }; 213 | 214 | dlmonitor.save_mendeley = function(pdf_url, paper_title) { 215 | $.notify("Saving " + paper_title, "info"); 216 | dlmonitor.ajaxCount ++; 217 | $.ajax({ 218 | url: '/save_mendeley', 219 | type: 'GET', 220 | data: { 221 | url: pdf_url 222 | }, 223 | error: function() { 224 | dlmonitor.ajaxCount --; 225 | $.notify("Error when saving paper.", "error"); 226 | }, 227 | success: function(data) { 228 | // console.log(data); 229 | dlmonitor.ajaxCount --; 230 | $.notify(data, "success"); 231 | } 232 | }); 233 | }; 234 | 235 | dlmonitor.load_fulltext = function(arxiv_token) { 236 | dlmonitor.ajaxCount ++; 237 | $.ajax({ 238 | url: '/load_fulltext/' + arxiv_token, 239 | type: 'GET', 240 | error: function() { 241 | dlmonitor.ajaxCount --; 242 | $("#latex-content").html("An error is detected when loading the paper."); 243 | }, 244 | success: function(data) { 245 | // console.log(data); 246 | dlmonitor.ajaxCount --; 247 | $("#latex-content").data("arxiv_token", arxiv_token); 248 | setTimeout(dlmonitor.retrieve_fulltext, 3000); 249 | } 250 | }); 251 | } 252 | 253 | dlmonitor.retrieve_fulltext = function() { 254 | dlmonitor.ajaxCount ++; 255 | arxiv_token = $("#latex-content").data("arxiv_token") 256 | $.ajax({ 257 | url: '/retrieve_fulltext/' + arxiv_token, 258 | type: 'GET', 259 | error: function() { 260 | dlmonitor.ajaxCount --; 261 | $("#latex-content").html("An error is detected when loading the paper."); 262 | }, 263 | success: function(data) { 264 | // console.log(data); 265 | dlmonitor.ajaxCount --; 266 | if (data == "PROCESSING" || data == "NOT_EXIST") { 267 | setTimeout(dlmonitor.retrieve_fulltext, 3000); 268 | } else if (data == "NOT_AVAILABE") { 269 | $("#latex-content").html("This feature is not avaialbe for this paper."); 270 | } else { 271 | $("#latex-content").html(data); 272 | } 273 | } 274 | }); 275 | }; 276 | 277 | dlmonitor.init = function() { 278 | dlmonitor.updateAll(true); 279 | $("#new-keyword-btn").on('click tap', dlmonitor.addKeyword); 280 | $('#new-keyword').keypress(function(e) { 281 | var key = e.which; 282 | if(key == 13) // the enter key code 283 | { 284 | $('#new-keyword-btn').click(); 285 | return false; 286 | } 287 | }); 288 | $('#new-keyword').on('keyup', function() { 289 | clearTimeout(dlmonitor.previewTimeout); 290 | dlmonitor.previewTimeout = setTimeout(function() { 291 | var text = $("#new-keyword").val(); 292 | if ($("#new-keyword").is(":focus") && text.length >= 3) { 293 | $("#preview-kw").html(text); 294 | $("#posts-preview").height(($(window).height() - 160) + "px") 295 | dlmonitor.switchPreview(true); 296 | dlmonitor.fetch('arxiv', text, 'preview'); 297 | } else { 298 | dlmonitor.switchPreview(false); 299 | } 300 | }, 200); 301 | if ($("#new-keyword").val().length < 3) { 302 | dlmonitor.switchPreview(false); 303 | } 304 | }); 305 | $("#close-btn-preview").on('click tap', function() { 306 | dlmonitor.switchPreview(false); 307 | $("#new-keyword").val(''); 308 | }); 309 | }; 310 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/default.css: -------------------------------------------------------------------------------- 1 | 2 | html, body 3 | { 4 | height: 100%; 5 | } 6 | 7 | 8 | body 9 | { 10 | margin: 0px; 11 | padding: 0px; 12 | background: #2b2b2b; 13 | font-family: 'Source Sans Pro', sans-serif; 14 | font-size: 11pt; 15 | font-weight: 300; 16 | color: #fff; 17 | } 18 | 19 | h1, h2, h3 20 | { 21 | margin: 0; 22 | padding: 0; 23 | font-weight: 600; 24 | color: #0ce3ac; 25 | } 26 | 27 | p, ol, ul 28 | { 29 | margin-top: 0; 30 | } 31 | 32 | ol, ul 33 | { 34 | padding: 0; 35 | list-style: none; 36 | } 37 | 38 | a { 39 | color: #fff; 40 | } 41 | 42 | p 43 | { 44 | line-height: 180%; 45 | } 46 | 47 | strong 48 | { 49 | } 50 | 51 | 52 | a:hover 53 | { 54 | text-decoration: none; 55 | } 56 | 57 | .container 58 | { 59 | margin: 0px auto; 60 | /* width: 1200px; */ 61 | } 62 | 63 | /*********************************************************************************/ 64 | /* List Styles */ 65 | /*********************************************************************************/ 66 | 67 | ul.style1 68 | { 69 | margin: 0; 70 | padding: 0em 0em 0em 0em; 71 | overflow: hidden; 72 | list-style: none; 73 | color: #6c6c6c 74 | } 75 | 76 | ul.style1 li 77 | { 78 | overflow: hidden; 79 | display: block; 80 | padding: 2.80em 0em; 81 | border-top: 1px solid #D1CFCE; 82 | } 83 | 84 | ul.style1 li:first-child 85 | { 86 | padding-top: 0; 87 | border-top: none; 88 | } 89 | 90 | ul.style1 .image-left 91 | { 92 | margin-bottom: 0; 93 | } 94 | 95 | ul.style1 h3 96 | { 97 | padding: 1.2em 0em 1em 0em; 98 | letter-spacing: 0.10em; 99 | text-transform: uppercase; 100 | font-size: 1.2em; 101 | font-weight: 600; 102 | color: #454445; 103 | } 104 | 105 | ul.style1 a 106 | { 107 | text-decoration: none; 108 | color: #525252; 109 | } 110 | 111 | ul.style1 a:hover 112 | { 113 | text-decoration: underline; 114 | color: #525252; 115 | } 116 | 117 | ul.style2 118 | { 119 | margin: 0; 120 | padding-top: 1em; 121 | list-style: none; 122 | } 123 | 124 | ul.style2 li 125 | { 126 | border-top: solid 1px #E5E5E5; 127 | padding: 0.80em 0 0.80em 0; 128 | font-family: 0.80em; 129 | } 130 | 131 | ul.style2 li:before 132 | { 133 | display: inline-block; 134 | padding: 4px; 135 | background: #DB3256; 136 | } 137 | 138 | ul.style2 a 139 | { 140 | display: inline-block; 141 | margin-left: 1em; 142 | } 143 | 144 | ul.style2 li:first-child 145 | { 146 | border-top: 0; 147 | padding-top: 0; 148 | } 149 | 150 | ul.style2 .icon 151 | { 152 | color: #FFF; 153 | } 154 | 155 | ul.style3 156 | { 157 | margin: 0; 158 | padding-top: 1em; 159 | list-style: none; 160 | } 161 | 162 | ul.style3 li 163 | { 164 | border-top: solid 1px rgba(255,255,255,.2); 165 | padding: 1em 0 1em 0; 166 | font-family: 0.80em; 167 | } 168 | 169 | ul.style3 li:before 170 | { 171 | display: inline-block; 172 | padding: 4px; 173 | 174 | } 175 | 176 | ul.style3 a 177 | { 178 | display: inline-block; 179 | margin-left: 1em; 180 | font-size: 1em !important; 181 | color: #FFF; 182 | } 183 | 184 | ul.style3 li:first-child 185 | { 186 | border-top: 0; 187 | padding-top: 0; 188 | } 189 | 190 | ul.style3 .icon 191 | { 192 | color: #DB3256; 193 | } 194 | 195 | 196 | /*********************************************************************************/ 197 | /* Social Icon Styles */ 198 | /*********************************************************************************/ 199 | 200 | ul.contact 201 | { 202 | margin: 0; 203 | padding: 2em 0em 0em 0em; 204 | list-style: none; 205 | } 206 | 207 | ul.contact li 208 | { 209 | display: inline-block; 210 | padding: 0em 0.30em; 211 | font-size: 1em; 212 | } 213 | 214 | ul.contact li span 215 | { 216 | display: none; 217 | margin: 0; 218 | padding: 0; 219 | } 220 | 221 | ul.contact li a 222 | { 223 | color: #FFF; 224 | } 225 | 226 | ul.contact li a:before 227 | { 228 | display: inline-block; 229 | background: #3f3f3f; 230 | width: 40px; 231 | height: 40px; 232 | line-height: 40px; 233 | border-radius: 20px; 234 | text-align: center; 235 | color: #FFFFFF; 236 | } 237 | 238 | ul.contact li a.icon-twitter:before 239 | { 240 | background: #2DAAE4; 241 | } 242 | 243 | ul.contact li a.icon-facebook:before 244 | { 245 | background: #39599F; 246 | } 247 | 248 | ul.contact li a.icon-dribbble:before 249 | { 250 | background: #C4376B; 251 | } 252 | 253 | ul.contact li a.icon-tumblr:before 254 | { 255 | background: #31516A; 256 | } 257 | 258 | ul.contact li a.icon-rss:before 259 | { 260 | background: #F2600B; 261 | } 262 | 263 | /*********************************************************************************/ 264 | /* Nav */ 265 | /*********************************************************************************/ 266 | 267 | .menu { 268 | overflow: hidden; 269 | height: 20px; 270 | } 271 | 272 | .keywords { 273 | padding: 20px 0; 274 | line-height: 32px; 275 | overflow-x: auto; 276 | left: 20px; 277 | } 278 | 279 | .keywords .label { 280 | font-size: 100%; 281 | margin: 0 2px; 282 | } 283 | 284 | .keywords .label:hover { 285 | background-color: #C62828; 286 | cursor: pointer; 287 | } 288 | 289 | .subtools { 290 | margin: -10px 0 10px 0; 291 | width: 100%; 292 | } 293 | 294 | .subtools .btn-group { 295 | float: right; 296 | } 297 | 298 | /*********************************************************************************/ 299 | /* Posts */ 300 | /*********************************************************************************/ 301 | 302 | 303 | #wrapper { 304 | width: 100%; 305 | padding: 0; 306 | overflow: visible; 307 | } 308 | 309 | .navbar { 310 | border-radius: 0; 311 | } 312 | 313 | nav .row { 314 | margin: 0; 315 | } 316 | 317 | .dummy-navbar { 318 | height: 70px; 319 | } 320 | 321 | #keywords::-webkit-scrollbar-track 322 | { 323 | -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 324 | border-radius: 10px; 325 | } 326 | 327 | #keywords::-webkit-scrollbar 328 | { 329 | width: 10px; 330 | } 331 | 332 | #keywords::-webkit-scrollbar-thumb 333 | { 334 | border-radius: 10px; 335 | background-image: -webkit-gradient(linear, 336 | left bottom, 337 | left top, 338 | color-stop(0.44, rgb(122,153,217)), 339 | color-stop(0.72, rgb(73,125,189)), 340 | color-stop(0.86, rgb(28,58,148))); 341 | } 342 | 343 | ::-webkit-scrollbar-track 344 | { 345 | -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 346 | border-radius: 10px; 347 | /*background-color: #F5F5F5;*/ 348 | } 349 | 350 | ::-webkit-scrollbar 351 | { 352 | width: 12px; 353 | /*background-color: #F5F5F5;*/ 354 | } 355 | 356 | ::-webkit-scrollbar-thumb 357 | { 358 | border-radius: 10px; 359 | -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); 360 | background-color: #555; 361 | } 362 | 363 | 364 | #header-wrapper, .navbar, .subtools{ 365 | z-index: 999; 366 | } 367 | 368 | .panel-heading { 369 | overflow: hidden; 370 | padding: 5px 15px; 371 | } 372 | 373 | .panel-heading h3 { 374 | float: left; 375 | } 376 | 377 | .close-btn { 378 | float: right; 379 | cursor: pointer; 380 | margin-top: 2px; 381 | } 382 | 383 | .close-btn:hover { 384 | background-color: #C62828; 385 | cursor: pointer; 386 | } 387 | 388 | .post-columns-wrapper { 389 | position: absolute; 390 | top: 0; 391 | left: 0; 392 | display: block; 393 | width: 100%; 394 | height: 100%; 395 | padding-top: 80px; 396 | min-height: 600px; 397 | } 398 | 399 | .post-columns-frame { 400 | width: 100%; 401 | height: 100%; 402 | overflow-y: hidden; 403 | overflow-x: auto; 404 | } 405 | 406 | .post-columns { 407 | width: 4000px; 408 | height: 100%; 409 | } 410 | 411 | 412 | .post-columns .column { 413 | width: 330px; 414 | padding: 0 3px; 415 | height: 100%; 416 | } 417 | 418 | .post-columns .panel { 419 | height: 100%; 420 | } 421 | 422 | 423 | .post-columns .panel-body { 424 | overflow-y: auto; 425 | height: inherit; 426 | } 427 | 428 | .hrline { 429 | border-bottom: #666 1px solid; 430 | } 431 | 432 | .post { 433 | margin: 5px 0; 434 | } 435 | 436 | .post .title { 437 | font-size: 18px; 438 | font-weight: 500; 439 | } 440 | 441 | 442 | .post .author { 443 | color: #ccc; 444 | } 445 | 446 | .post .tools { 447 | margin-top: 10px; 448 | } 449 | 450 | .post .label { 451 | font-size: 100%; 452 | } 453 | 454 | .post .label-hot { 455 | background: #FF6D00; 456 | font-weight: normal; 457 | } 458 | 459 | .post .btns { 460 | /*float: right;*/ 461 | } 462 | 463 | .post .btn { 464 | padding: 0; 465 | } 466 | 467 | .twittersrc .title a { 468 | color: #ccc; 469 | font-size: 16px; 470 | } 471 | 472 | .twittersrc .author { 473 | font-size: 16px; 474 | color: #fff; 475 | } 476 | 477 | .twittersrc .author a { 478 | color: #0ce3ac; 479 | } 480 | 481 | .post-columns .column { 482 | float: left; 483 | } 484 | 485 | .column .panel-body { 486 | padding: 5px 15px; 487 | } 488 | 489 | .column:first-child .left-btn { 490 | display: none; 491 | } 492 | 493 | .column:last-child .right-btn { 494 | display: none; 495 | } 496 | 497 | /*** Preview ***/ 498 | 499 | .preview { 500 | position: absolute; 501 | top: 80px; 502 | left: 0; 503 | width: 100%; 504 | z-index: 999; 505 | } 506 | 507 | .preview .panel { 508 | width: 90%; 509 | margin: 0 auto; 510 | } 511 | 512 | #posts-preview { 513 | height: 800px; 514 | overflow-y: auto; 515 | } 516 | 517 | /*********************************************************************************/ 518 | /* Header */ 519 | /*********************************************************************************/ 520 | 521 | #header-wrapper 522 | { 523 | background: #2b2b2b; 524 | } 525 | 526 | #header 527 | { 528 | position: relative; 529 | height: 100px; 530 | } 531 | 532 | #mendeley-btn { 533 | margin-left: 30%; 534 | } 535 | 536 | .mendeley-box { 537 | width: 80%; 538 | height: 45px; 539 | margin: 12px 0 12px 10%; 540 | font-weight: bold; 541 | } 542 | 543 | .mendeley-box a { 544 | font-weight: normal; 545 | } 546 | 547 | .mendeley-box img { 548 | width: 35px; 549 | height: 35px; 550 | margin-top: 3px; 551 | } 552 | 553 | .profile { 554 | display: block; 555 | text-overflow: ellipsis; 556 | overflow: hidden; 557 | white-space: nowrap; 558 | } 559 | 560 | /*********************************************************************************/ 561 | /* Logo */ 562 | /*********************************************************************************/ 563 | 564 | #logo 565 | { 566 | position: absolute; 567 | top: 2em; 568 | width: 100%; 569 | } 570 | 571 | #logo h1 572 | { 573 | display: inline-block; 574 | font-size: 2.5em; 575 | text-transform: uppercase; 576 | font-weight: 700; 577 | color: #ED7070; 578 | padding-right: 0.50em; 579 | border-right: 1px solid rgba(0,0,0,.1); 580 | } 581 | 582 | #logo span 583 | { 584 | display: inline-block; 585 | padding-right: .50em; 586 | letter-spacing: 0.10em; 587 | text-transform: uppercase; 588 | font-size: 0.90em; 589 | } 590 | 591 | #logo a 592 | { 593 | text-decoration: none; 594 | color: #FFF; 595 | } 596 | 597 | #logo .fa 598 | { 599 | color: #1E88E5; 600 | } 601 | 602 | #logo .fa:after 603 | { 604 | position: absolute; 605 | display: inline-block; 606 | padding-right: 2em; 607 | } 608 | 609 | /*********************************************************************************/ 610 | /* Menu */ 611 | /*********************************************************************************/ 612 | 613 | #menu 614 | { 615 | position: absolute; 616 | right: 0; 617 | top: 1.6em; 618 | } 619 | 620 | #menu ul 621 | { 622 | display: inline-block; 623 | } 624 | 625 | #menu li 626 | { 627 | display: block; 628 | float: left; 629 | text-align: center; 630 | } 631 | 632 | #menu li a, #menu li span 633 | { 634 | display: inline-block; 635 | margin-left: 1px; 636 | padding: 1em 1.5em 1em 1.5em; 637 | letter-spacing: 0.10em; 638 | text-decoration: none; 639 | font-size: 1em; 640 | text-transform: uppercase; 641 | outline: 0; 642 | color: #FFF; 643 | } 644 | 645 | #menu li:hover a, #menu li.active a, #menu li.active span 646 | { 647 | } 648 | 649 | #menu .current_page_item a 650 | { 651 | background: #1E88E5; 652 | border-radius: 30px; 653 | color: #FFF; 654 | } 655 | 656 | /* 657 | Single 658 | */ 659 | 660 | .list-group .fa-circle { 661 | text-align: left; 662 | margin: 0 10px; 663 | } 664 | 665 | /*** 666 | Latex 667 | ***/ 668 | 669 | #latex-content { 670 | font-size: 16px; 671 | } 672 | 673 | .ltx_title_document, .ltx_authors, .ltx_abstract, .ltx_ERROR, .ltx_page_footer { 674 | display: none; 675 | } 676 | 677 | .ltx_tabular tr, .ltx_tr, .ltx_td { 678 | border-color: white; 679 | } 680 | 681 | .ltx_tabular tr td { 682 | border-color: white; 683 | } 684 | 685 | .ltx_note_mark { 686 | color: #0ce3ac; 687 | } 688 | 689 | 690 | .sk-folding-cube { 691 | margin: 20px auto; 692 | width: 40px; 693 | height: 40px; 694 | position: relative; 695 | -webkit-transform: rotateZ(45deg); 696 | transform: rotateZ(45deg); 697 | } 698 | 699 | .sk-folding-cube .sk-cube { 700 | float: left; 701 | width: 50%; 702 | height: 50%; 703 | position: relative; 704 | background-color: white; 705 | -webkit-transform: scale(1.1); 706 | -ms-transform: scale(1.1); 707 | transform: scale(1.1); 708 | } 709 | .sk-folding-cube .sk-cube:before { 710 | content: ''; 711 | position: absolute; 712 | top: 0; 713 | left: 0; 714 | width: 100%; 715 | height: 100%; 716 | background-color: #333; 717 | -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both; 718 | animation: sk-foldCubeAngle 2.4s infinite linear both; 719 | -webkit-transform-origin: 100% 100%; 720 | -ms-transform-origin: 100% 100%; 721 | transform-origin: 100% 100%; 722 | } 723 | .sk-folding-cube .sk-cube2 { 724 | -webkit-transform: scale(1.1) rotateZ(90deg); 725 | transform: scale(1.1) rotateZ(90deg); 726 | } 727 | .sk-folding-cube .sk-cube3 { 728 | -webkit-transform: scale(1.1) rotateZ(180deg); 729 | transform: scale(1.1) rotateZ(180deg); 730 | } 731 | .sk-folding-cube .sk-cube4 { 732 | -webkit-transform: scale(1.1) rotateZ(270deg); 733 | transform: scale(1.1) rotateZ(270deg); 734 | } 735 | .sk-folding-cube .sk-cube2:before { 736 | -webkit-animation-delay: 0.3s; 737 | animation-delay: 0.3s; 738 | } 739 | .sk-folding-cube .sk-cube3:before { 740 | -webkit-animation-delay: 0.6s; 741 | animation-delay: 0.6s; 742 | } 743 | .sk-folding-cube .sk-cube4:before { 744 | -webkit-animation-delay: 0.9s; 745 | animation-delay: 0.9s; 746 | } 747 | @-webkit-keyframes sk-foldCubeAngle { 748 | 0%, 10% { 749 | -webkit-transform: perspective(140px) rotateX(-180deg); 750 | transform: perspective(140px) rotateX(-180deg); 751 | opacity: 0; 752 | } 25%, 75% { 753 | -webkit-transform: perspective(140px) rotateX(0deg); 754 | transform: perspective(140px) rotateX(0deg); 755 | opacity: 1; 756 | } 90%, 100% { 757 | -webkit-transform: perspective(140px) rotateY(180deg); 758 | transform: perspective(140px) rotateY(180deg); 759 | opacity: 0; 760 | } 761 | } 762 | 763 | @keyframes sk-foldCubeAngle { 764 | 0%, 10% { 765 | -webkit-transform: perspective(140px) rotateX(-180deg); 766 | transform: perspective(140px) rotateX(-180deg); 767 | opacity: 0; 768 | } 25%, 75% { 769 | -webkit-transform: perspective(140px) rotateX(0deg); 770 | transform: perspective(140px) rotateX(0deg); 771 | opacity: 1; 772 | } 90%, 100% { 773 | -webkit-transform: perspective(140px) rotateY(180deg); 774 | transform: perspective(140px) rotateY(180deg); 775 | opacity: 0; 776 | } 777 | } 778 | 779 | figure img { 780 | background-color:white; 781 | } 782 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/fonts.css: -------------------------------------------------------------------------------- 1 | @charset 'UTF-8'; 2 | 3 | @font-face 4 | { 5 | font-family: 'FontAwesome'; 6 | src: url('fonts/fontawesome-webfont.eot?v=3.0.1'); 7 | src: url('fonts/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), 8 | url('fonts/fontawesome-webfont.woff?v=3.0.1') format('woff'), 9 | url('fonts/fontawesome-webfont.ttf?v=3.0.1') format('truetype'), 10 | url('fonts/fontawesome-webfont.svg#FontAwesome') format('svg'); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | @font-face 16 | { 17 | font-family: 'Font-Awesome-Social'; 18 | src: url('fonts/fontawesome-social-webfont.eot'); 19 | src: url('fonts/fontawesome-social-webfont.eot?#iefix') format('embedded-opentype'), 20 | url('fonts/fontawesome-social-webfont.woff') format('woff'), 21 | url('fonts/fontawesome-social-webfont.ttf') format('truetype'), 22 | url('fonts/fontawesome-social-webfont.svg#Font-Awesome-More') format('svg'); 23 | font-weight: normal; 24 | font-style: normal; 25 | } 26 | /*********************************************************************************/ 27 | /* Icons */ 28 | /* Powered by Font Awesome by Dave Gandy | http://fontawesome.io */ 29 | /* Licensed under the SIL OFL 1.1 (font), MIT (CSS) */ 30 | /*********************************************************************************/ 31 | 32 | .fa 33 | { 34 | text-decoration: none; 35 | } 36 | 37 | .fa:before 38 | { 39 | display:inline-block; 40 | font-family: FontAwesome; 41 | font-size: 1.25em; 42 | text-decoration: none; 43 | font-style: normal; 44 | font-weight: normal; 45 | line-height: 1; 46 | -webkit-font-smoothing:antialiased; 47 | -moz-osx-font-smoothing:grayscale; 48 | } 49 | 50 | .fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%} 51 | .fa-2x{font-size:2em} 52 | .fa-3x{font-size:3em} 53 | .fa-4x{font-size:4em} 54 | .fa-5x{font-size:5em} 55 | .fa-fw{width:1.2857142857142858em;text-align:center} 56 | .fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative} 57 | .fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em} 58 | .fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em} 59 | .pull-right{float:right} 60 | .pull-left{float:left} 61 | .fa.pull-left{margin-right:.3em} 62 | .fa.pull-right{margin-left:.3em} 63 | .fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear} 64 | @-moz-keyframes spin{0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)} 100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)} 100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)} 65 | .fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)} 66 | .fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)} 67 | .fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1)} 68 | .fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1)} 69 | .fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle} 70 | .fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center} 71 | .fa-stack-1x{line-height:inherit} 72 | .fa-stack-2x{font-size:2em} 73 | .fa-inverse{color:#fff} 74 | .fa-glass:before{content:"\f000"} 75 | .fa-music:before{content:"\f001"} 76 | .fa-search:before{content:"\f002"} 77 | .fa-envelope-o:before{content:"\f003"} 78 | .fa-heart:before{content:"\f004"} 79 | .fa-star:before{content:"\f005"} 80 | .fa-star-o:before{content:"\f006"} 81 | .fa-user:before{content:"\f007"} 82 | .fa-film:before{content:"\f008"} 83 | .fa-th-large:before{content:"\f009"} 84 | .fa-th:before{content:"\f00a"} 85 | .fa-th-list:before{content:"\f00b"} 86 | .fa-check:before{content:"\f00c"} 87 | .fa-times:before{content:"\f00d"} 88 | .fa-search-plus:before{content:"\f00e"} 89 | .fa-search-minus:before{content:"\f010"} 90 | .fa-power-off:before{content:"\f011"} 91 | .fa-signal:before{content:"\f012"} 92 | .fa-gear:before,.fa-cog:before{content:"\f013"} 93 | .fa-trash-o:before{content:"\f014"} 94 | .fa-home:before{content:"\f015"} 95 | .fa-file-o:before{content:"\f016"} 96 | .fa-clock-o:before{content:"\f017"} 97 | .fa-road:before{content:"\f018"} 98 | .fa-download:before{content:"\f019"} 99 | .fa-arrow-circle-o-down:before{content:"\f01a"} 100 | .fa-arrow-circle-o-up:before{content:"\f01b"} 101 | .fa-inbox:before{content:"\f01c"} 102 | .fa-play-circle-o:before{content:"\f01d"} 103 | .fa-rotate-right:before,.fa-repeat:before{content:"\f01e"} 104 | .fa-refresh:before{content:"\f021"} 105 | .fa-list-alt:before{content:"\f022"} 106 | .fa-lock:before{content:"\f023"} 107 | .fa-flag:before{content:"\f024"} 108 | .fa-headphones:before{content:"\f025"} 109 | .fa-volume-off:before{content:"\f026"} 110 | .fa-volume-down:before{content:"\f027"} 111 | .fa-volume-up:before{content:"\f028"} 112 | .fa-qrcode:before{content:"\f029"} 113 | .fa-barcode:before{content:"\f02a"} 114 | .fa-tag:before{content:"\f02b"} 115 | .fa-tags:before{content:"\f02c"} 116 | .fa-book:before{content:"\f02d"} 117 | .fa-bookmark:before{content:"\f02e"} 118 | .fa-print:before{content:"\f02f"} 119 | .fa-camera:before{content:"\f030"} 120 | .fa-font:before{content:"\f031"} 121 | .fa-bold:before{content:"\f032"} 122 | .fa-italic:before{content:"\f033"} 123 | .fa-text-height:before{content:"\f034"} 124 | .fa-text-width:before{content:"\f035"} 125 | .fa-align-left:before{content:"\f036"} 126 | .fa-align-center:before{content:"\f037"} 127 | .fa-align-right:before{content:"\f038"} 128 | .fa-align-justify:before{content:"\f039"} 129 | .fa-list:before{content:"\f03a"} 130 | .fa-dedent:before,.fa-outdent:before{content:"\f03b"} 131 | .fa-indent:before{content:"\f03c"} 132 | .fa-video-camera:before{content:"\f03d"} 133 | .fa-picture-o:before{content:"\f03e"} 134 | .fa-pencil:before{content:"\f040"} 135 | .fa-map-marker:before{content:"\f041"} 136 | .fa-adjust:before{content:"\f042"} 137 | .fa-tint:before{content:"\f043"} 138 | .fa-edit:before,.fa-pencil-square-o:before{content:"\f044"} 139 | .fa-share-square-o:before{content:"\f045"} 140 | .fa-check-square-o:before{content:"\f046"} 141 | .fa-move:before{content:"\f047"} 142 | .fa-step-backward:before{content:"\f048"} 143 | .fa-fast-backward:before{content:"\f049"} 144 | .fa-backward:before{content:"\f04a"} 145 | .fa-play:before{content:"\f04b"} 146 | .fa-pause:before{content:"\f04c"} 147 | .fa-stop:before{content:"\f04d"} 148 | .fa-forward:before{content:"\f04e"} 149 | .fa-fast-forward:before{content:"\f050"} 150 | .fa-step-forward:before{content:"\f051"} 151 | .fa-eject:before{content:"\f052"} 152 | .fa-chevron-left:before{content:"\f053"} 153 | .fa-chevron-right:before{content:"\f054"} 154 | .fa-plus-circle:before{content:"\f055"} 155 | .fa-minus-circle:before{content:"\f056"} 156 | .fa-times-circle:before{content:"\f057"} 157 | .fa-check-circle:before{content:"\f058"} 158 | .fa-question-circle:before{content:"\f059"} 159 | .fa-info-circle:before{content:"\f05a"} 160 | .fa-crosshairs:before{content:"\f05b"} 161 | .fa-times-circle-o:before{content:"\f05c"} 162 | .fa-check-circle-o:before{content:"\f05d"} 163 | .fa-ban:before{content:"\f05e"} 164 | .fa-arrow-left:before{content:"\f060"} 165 | .fa-arrow-right:before{content:"\f061"} 166 | .fa-arrow-up:before{content:"\f062"} 167 | .fa-arrow-down:before{content:"\f063"} 168 | .fa-mail-forward:before,.fa-share:before{content:"\f064"} 169 | .fa-resize-full:before{content:"\f065"} 170 | .fa-resize-small:before{content:"\f066"} 171 | .fa-plus:before{content:"\f067"} 172 | .fa-minus:before{content:"\f068"} 173 | .fa-asterisk:before{content:"\f069"} 174 | .fa-exclamation-circle:before{content:"\f06a"} 175 | .fa-gift:before{content:"\f06b"} 176 | .fa-leaf:before{content:"\f06c"} 177 | .fa-fire:before{content:"\f06d"} 178 | .fa-eye:before{content:"\f06e"} 179 | .fa-eye-slash:before{content:"\f070"} 180 | .fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"} 181 | .fa-plane:before{content:"\f072"} 182 | .fa-calendar:before{content:"\f073"} 183 | .fa-random:before{content:"\f074"} 184 | .fa-comment:before{content:"\f075"} 185 | .fa-magnet:before{content:"\f076"} 186 | .fa-chevron-up:before{content:"\f077"} 187 | .fa-chevron-down:before{content:"\f078"} 188 | .fa-retweet:before{content:"\f079"} 189 | .fa-shopping-cart:before{content:"\f07a"} 190 | .fa-folder:before{content:"\f07b"} 191 | .fa-folder-open:before{content:"\f07c"} 192 | .fa-resize-vertical:before{content:"\f07d"} 193 | .fa-resize-horizontal:before{content:"\f07e"} 194 | .fa-bar-chart-o:before{content:"\f080"} 195 | .fa-twitter-square:before{content:"\f081"} 196 | .fa-facebook-square:before{content:"\f082"} 197 | .fa-camera-retro:before{content:"\f083"} 198 | .fa-key:before{content:"\f084"} 199 | .fa-gears:before,.fa-cogs:before{content:"\f085"} 200 | .fa-comments:before{content:"\f086"} 201 | .fa-thumbs-o-up:before{content:"\f087"} 202 | .fa-thumbs-o-down:before{content:"\f088"} 203 | .fa-star-half:before{content:"\f089"} 204 | .fa-heart-o:before{content:"\f08a"} 205 | .fa-sign-out:before{content:"\f08b"} 206 | .fa-linkedin-square:before{content:"\f08c"} 207 | .fa-thumb-tack:before{content:"\f08d"} 208 | .fa-external-link:before{content:"\f08e"} 209 | .fa-sign-in:before{content:"\f090"} 210 | .fa-trophy:before{content:"\f091"} 211 | .fa-github-square:before{content:"\f092"} 212 | .fa-upload:before{content:"\f093"} 213 | .fa-lemon-o:before{content:"\f094"} 214 | .fa-phone:before{content:"\f095"} 215 | .fa-square-o:before{content:"\f096"} 216 | .fa-bookmark-o:before{content:"\f097"} 217 | .fa-phone-square:before{content:"\f098"} 218 | .fa-twitter:before{content:"\f099"} 219 | .fa-facebook:before{content:"\f09a"} 220 | .fa-github:before{content:"\f09b"} 221 | .fa-unlock:before{content:"\f09c"} 222 | .fa-credit-card:before{content:"\f09d"} 223 | .fa-rss:before{content:"\f09e"} 224 | .fa-hdd-o:before{content:"\f0a0"} 225 | .fa-bullhorn:before{content:"\f0a1"} 226 | .fa-bell:before{content:"\f0f3"} 227 | .fa-certificate:before{content:"\f0a3"} 228 | .fa-hand-o-right:before{content:"\f0a4"} 229 | .fa-hand-o-left:before{content:"\f0a5"} 230 | .fa-hand-o-up:before{content:"\f0a6"} 231 | .fa-hand-o-down:before{content:"\f0a7"} 232 | .fa-arrow-circle-left:before{content:"\f0a8"} 233 | .fa-arrow-circle-right:before{content:"\f0a9"} 234 | .fa-arrow-circle-up:before{content:"\f0aa"} 235 | .fa-arrow-circle-down:before{content:"\f0ab"} 236 | .fa-globe:before{content:"\f0ac"} 237 | .fa-wrench:before{content:"\f0ad"} 238 | .fa-tasks:before{content:"\f0ae"} 239 | .fa-filter:before{content:"\f0b0"} 240 | .fa-briefcase:before{content:"\f0b1"} 241 | .fa-fullscreen:before{content:"\f0b2"} 242 | .fa-group:before{content:"\f0c0"} 243 | .fa-chain:before,.fa-link:before{content:"\f0c1"} 244 | .fa-cloud:before{content:"\f0c2"} 245 | .fa-flask:before{content:"\f0c3"} 246 | .fa-cut:before,.fa-scissors:before{content:"\f0c4"} 247 | .fa-copy:before,.fa-files-o:before{content:"\f0c5"} 248 | .fa-paperclip:before{content:"\f0c6"} 249 | .fa-save:before,.fa-floppy-o:before{content:"\f0c7"} 250 | .fa-square:before{content:"\f0c8"} 251 | .fa-reorder:before{content:"\f0c9"} 252 | .fa-list-ul:before{content:"\f0ca"} 253 | .fa-list-ol:before{content:"\f0cb"} 254 | .fa-strikethrough:before{content:"\f0cc"} 255 | .fa-underline:before{content:"\f0cd"} 256 | .fa-table:before{content:"\f0ce"} 257 | .fa-magic:before{content:"\f0d0"} 258 | .fa-truck:before{content:"\f0d1"} 259 | .fa-pinterest:before{content:"\f0d2"} 260 | .fa-pinterest-square:before{content:"\f0d3"} 261 | .fa-google-plus-square:before{content:"\f0d4"} 262 | .fa-google-plus:before{content:"\f0d5"} 263 | .fa-money:before{content:"\f0d6"} 264 | .fa-caret-down:before{content:"\f0d7"} 265 | .fa-caret-up:before{content:"\f0d8"} 266 | .fa-caret-left:before{content:"\f0d9"} 267 | .fa-caret-right:before{content:"\f0da"} 268 | .fa-columns:before{content:"\f0db"} 269 | .fa-unsorted:before,.fa-sort:before{content:"\f0dc"} 270 | .fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"} 271 | .fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"} 272 | .fa-envelope:before{content:"\f0e0"} 273 | .fa-linkedin:before{content:"\f0e1"} 274 | .fa-rotate-left:before,.fa-undo:before{content:"\f0e2"} 275 | .fa-legal:before,.fa-gavel:before{content:"\f0e3"} 276 | .fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"} 277 | .fa-comment-o:before{content:"\f0e5"} 278 | .fa-comments-o:before{content:"\f0e6"} 279 | .fa-flash:before,.fa-bolt:before{content:"\f0e7"} 280 | .fa-sitemap:before{content:"\f0e8"} 281 | .fa-umbrella:before{content:"\f0e9"} 282 | .fa-paste:before,.fa-clipboard:before{content:"\f0ea"} 283 | .fa-lightbulb-o:before{content:"\f0eb"} 284 | .fa-exchange:before{content:"\f0ec"} 285 | .fa-cloud-download:before{content:"\f0ed"} 286 | .fa-cloud-upload:before{content:"\f0ee"} 287 | .fa-user-md:before{content:"\f0f0"} 288 | .fa-stethoscope:before{content:"\f0f1"} 289 | .fa-suitcase:before{content:"\f0f2"} 290 | .fa-bell-o:before{content:"\f0a2"} 291 | .fa-coffee:before{content:"\f0f4"} 292 | .fa-cutlery:before{content:"\f0f5"} 293 | .fa-file-text-o:before{content:"\f0f6"} 294 | .fa-building:before{content:"\f0f7"} 295 | .fa-hospital:before{content:"\f0f8"} 296 | .fa-ambulance:before{content:"\f0f9"} 297 | .fa-medkit:before{content:"\f0fa"} 298 | .fa-fighter-jet:before{content:"\f0fb"} 299 | .fa-beer:before{content:"\f0fc"} 300 | .fa-h-square:before{content:"\f0fd"} 301 | .fa-plus-square:before{content:"\f0fe"} 302 | .fa-angle-double-left:before{content:"\f100"} 303 | .fa-angle-double-right:before{content:"\f101"} 304 | .fa-angle-double-up:before{content:"\f102"} 305 | .fa-angle-double-down:before{content:"\f103"} 306 | .fa-angle-left:before{content:"\f104"} 307 | .fa-angle-right:before{content:"\f105"} 308 | .fa-angle-up:before{content:"\f106"} 309 | .fa-angle-down:before{content:"\f107"} 310 | .fa-desktop:before{content:"\f108"} 311 | .fa-laptop:before{content:"\f109"} 312 | .fa-tablet:before{content:"\f10a"} 313 | .fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"} 314 | .fa-circle-o:before{content:"\f10c"} 315 | .fa-quote-left:before{content:"\f10d"} 316 | .fa-quote-right:before{content:"\f10e"} 317 | .fa-spinner:before{content:"\f110"} 318 | .fa-circle:before{content:"\f111"} 319 | .fa-mail-reply:before,.fa-reply:before{content:"\f112"} 320 | .fa-github-alt:before{content:"\f113"} 321 | .fa-folder-o:before{content:"\f114"} 322 | .fa-folder-open-o:before{content:"\f115"} 323 | .fa-expand-o:before{content:"\f116"} 324 | .fa-collapse-o:before{content:"\f117"} 325 | .fa-smile-o:before{content:"\f118"} 326 | .fa-frown-o:before{content:"\f119"} 327 | .fa-meh-o:before{content:"\f11a"} 328 | .fa-gamepad:before{content:"\f11b"} 329 | .fa-keyboard-o:before{content:"\f11c"} 330 | .fa-flag-o:before{content:"\f11d"} 331 | .fa-flag-checkered:before{content:"\f11e"} 332 | .fa-terminal:before{content:"\f120"} 333 | .fa-code:before{content:"\f121"} 334 | .fa-reply-all:before{content:"\f122"} 335 | .fa-mail-reply-all:before{content:"\f122"} 336 | .fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"} 337 | .fa-location-arrow:before{content:"\f124"} 338 | .fa-crop:before{content:"\f125"} 339 | .fa-code-fork:before{content:"\f126"} 340 | .fa-unlink:before,.fa-chain-broken:before{content:"\f127"} 341 | .fa-question:before{content:"\f128"} 342 | .fa-info:before{content:"\f129"} 343 | .fa-exclamation:before{content:"\f12a"} 344 | .fa-superscript:before{content:"\f12b"} 345 | .fa-subscript:before{content:"\f12c"} 346 | .fa-eraser:before{content:"\f12d"} 347 | .fa-puzzle-piece:before{content:"\f12e"} 348 | .fa-microphone:before{content:"\f130"} 349 | .fa-microphone-slash:before{content:"\f131"} 350 | .fa-shield:before{content:"\f132"} 351 | .fa-calendar-o:before{content:"\f133"} 352 | .fa-fire-extinguisher:before{content:"\f134"} 353 | .fa-rocket:before{content:"\f135"} 354 | .fa-maxcdn:before{content:"\f136"} 355 | .fa-chevron-circle-left:before{content:"\f137"} 356 | .fa-chevron-circle-right:before{content:"\f138"} 357 | .fa-chevron-circle-up:before{content:"\f139"} 358 | .fa-chevron-circle-down:before{content:"\f13a"} 359 | .fa-html5:before{content:"\f13b"} 360 | .fa-css3:before{content:"\f13c"} 361 | .fa-anchor:before{content:"\f13d"} 362 | .fa-unlock-o:before{content:"\f13e"} 363 | .fa-bullseye:before{content:"\f140"} 364 | .fa-ellipsis-horizontal:before{content:"\f141"} 365 | .fa-ellipsis-vertical:before{content:"\f142"} 366 | .fa-rss-square:before{content:"\f143"} 367 | .fa-play-circle:before{content:"\f144"} 368 | .fa-ticket:before{content:"\f145"} 369 | .fa-minus-square:before{content:"\f146"} 370 | .fa-minus-square-o:before{content:"\f147"} 371 | .fa-level-up:before{content:"\f148"} 372 | .fa-level-down:before{content:"\f149"} 373 | .fa-check-square:before{content:"\f14a"} 374 | .fa-pencil-square:before{content:"\f14b"} 375 | .fa-external-link-square:before{content:"\f14c"} 376 | .fa-share-square:before{content:"\f14d"} 377 | .fa-compass:before{content:"\f14e"} 378 | .fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"} 379 | .fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"} 380 | .fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"} 381 | .fa-euro:before,.fa-eur:before{content:"\f153"} 382 | .fa-gbp:before{content:"\f154"} 383 | .fa-dollar:before,.fa-usd:before{content:"\f155"} 384 | .fa-rupee:before,.fa-inr:before{content:"\f156"} 385 | .fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"} 386 | .fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"} 387 | .fa-won:before,.fa-krw:before{content:"\f159"} 388 | .fa-bitcoin:before,.fa-btc:before{content:"\f15a"} 389 | .fa-file:before{content:"\f15b"} 390 | .fa-file-text:before{content:"\f15c"} 391 | .fa-sort-alpha-asc:before{content:"\f15d"} 392 | .fa-sort-alpha-desc:before{content:"\f15e"} 393 | .fa-sort-amount-asc:before{content:"\f160"} 394 | .fa-sort-amount-desc:before{content:"\f161"} 395 | .fa-sort-numeric-asc:before{content:"\f162"} 396 | .fa-sort-numeric-desc:before{content:"\f163"} 397 | .fa-thumbs-up:before{content:"\f164"} 398 | .fa-thumbs-down:before{content:"\f165"} 399 | .fa-youtube-square:before{content:"\f166"} 400 | .fa-youtube:before{content:"\f167"} 401 | .fa-xing:before{content:"\f168"} 402 | .fa-xing-square:before{content:"\f169"} 403 | .fa-youtube-play:before{content:"\f16a"} 404 | .fa-dropbox:before{content:"\f16b"} 405 | .fa-stack-overflow:before{content:"\f16c"} 406 | .fa-instagram:before{content:"\f16d"} 407 | .fa-flickr:before{content:"\f16e"} 408 | .fa-adn:before{content:"\f170"} 409 | .fa-bitbucket:before{content:"\f171"} 410 | .fa-bitbucket-square:before{content:"\f172"} 411 | .fa-tumblr:before{content:"\f173"} 412 | .fa-tumblr-square:before{content:"\f174"} 413 | .fa-long-arrow-down:before{content:"\f175"} 414 | .fa-long-arrow-up:before{content:"\f176"} 415 | .fa-long-arrow-left:before{content:"\f177"} 416 | .fa-long-arrow-right:before{content:"\f178"} 417 | .fa-apple:before{content:"\f179"} 418 | .fa-windows:before{content:"\f17a"} 419 | .fa-android:before{content:"\f17b"} 420 | .fa-linux:before{content:"\f17c"} 421 | .fa-dribbble:before{content:"\f17d"} 422 | .fa-skype:before{content:"\f17e"} 423 | .fa-foursquare:before{content:"\f180"} 424 | .fa-trello:before{content:"\f181"} 425 | .fa-female:before{content:"\f182"} 426 | .fa-male:before{content:"\f183"} 427 | .fa-gittip:before{content:"\f184"} 428 | .fa-sun-o:before{content:"\f185"} 429 | .fa-moon-o:before{content:"\f186"} 430 | .fa-archive:before{content:"\f187"} 431 | .fa-bug:before{content:"\f188"} 432 | .fa-vk:before{content:"\f189"} 433 | .fa-weibo:before{content:"\f18a"} 434 | .fa-renren:before{content:"\f18b"} 435 | .fa-pagelines:before{content:"\f18c"} 436 | .fa-stack-exchange:before{content:"\f18d"} 437 | .fa-arrow-circle-o-right:before{content:"\f18e"} 438 | .fa-arrow-circle-o-left:before{content:"\f190"} 439 | .fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"} 440 | .fa-dot-circle-o:before{content:"\f192"} 441 | .fa-wheelchair:before{content:"\f193"} 442 | .fa-vimeo-square:before{content:"\f194"} 443 | .fa-turkish-lira:before,.fa-try:before{content:"\f195"} 444 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/dlmonitor/webapp/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /dlmonitor/webapp/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/dlmonitor/webapp/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /dlmonitor/webapp/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/dlmonitor/webapp/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /dlmonitor/webapp/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/dlmonitor/webapp/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /dlmonitor/webapp/static/ltx-article.css: -------------------------------------------------------------------------------- 1 | 2 | .ltx_title_document { font-size:170%; text-align:center; margin:0.5em 0 0.5em 0; } 3 | .ltx_authors, 4 | .ltx_role_author { text-align:center; margin:0.5em 0 0.5em 0; } 5 | .ltx_role_author .ltx_personname { font-size: 120%; } 6 | .ltx_date { text-align:center; font-size: 120%; margin:0.5em 0 0.5em 0; } 7 | .ltx_subtitle { text-align:center; font-size: 120%; padding-left:0.2em; margin-left:-0.5em; } 8 | 9 | .ltx_title_abstract { text-align:center; font-size: 100%; font-weight:bold; } 10 | .ltx_abstract { margin-left:4em; margin-right:4em; } 11 | .ltx_title_acknowledgements, 12 | .ltx_title_keywords, 13 | .ltx_title_classification { 14 | text-align:left; font-size: 100%; font-weight:bold; margin:0.5 0 0 0; } 15 | 16 | .ltx_appendix, 17 | .ltx_section, 18 | .ltx_subsection, 19 | .ltx_subsubsection { margin-top:1.5em; } 20 | .ltx_paragraph, 21 | .ltx_subparagraph { margin-top:1.0em; } 22 | 23 | .ltx_title_appendix, 24 | .ltx_title_section { font-size:140%; font-weight:bold; margin-bottom:1em; } 25 | .ltx_title_subsection { font-size:120%; font-weight:bold; margin-bottom:1em; } 26 | .ltx_title_subsubsection { font-size:100%; font-weight:bold; margin-bottom:1em; } 27 | 28 | /* Paragraph & Subparagraph titles should be runin! */ 29 | .ltx_title_paragraph { font-size:100%; font-weight:bold; display:inline; 30 | margin-right:1em; } 31 | .ltx_paragraph .ltx_title, 32 | .ltx_paragraph .ltx_title + .ltx_para, 33 | .ltx_paragraph .ltx_title + .ltx_para > .ltx_p { display:inline; } 34 | 35 | .ltx_title_subparagraph { font-size:100%; font-weight:bold; display:inline; 36 | margin-left:2em; margin-right:1em; } 37 | .ltx_subparagraph .ltx_title, 38 | .ltx_subparagraph .ltx_title + .ltx_para, 39 | .ltx_subparagraph .ltx_title + .ltx_para > .ltx_p { display:inline; } 40 | 41 | .ltx_figure { text-align:center; margin:auto; margin:0.5em; } 42 | .ltx_table { text-align:center; margin:auto; margin:0.5em; } 43 | 44 | /* first p in para gets indented */ 45 | .ltx_para > .ltx_p:first-child { text-indent:2em; } 46 | /* except the initial in a section */ 47 | section > .ltx_title +.ltx_para > .ltx_p, 48 | section > .ltx_title +.ltx_date +.ltx_para > .ltx_p {text-indent:0em; } 49 | 50 | .ltx_title_abstract + .ltx_p {text-indent:2em; } 51 | 52 | .ltx_itemize { margin-left:1em; } 53 | 54 | .ltx_theorem { margin-top:0.5em; margin-bottom:0.5em; } 55 | .ltx_theorem .ltx_title { margin-bottom:0.1em; } 56 | .ltx_theorem .ltx_title + .ltx_para, 57 | .ltx_theorem .ltx_title + .ltx_para .ltx_p, 58 | .ltx_theorem .ltx_title + .ltx_p { margin-top:0em; } 59 | -------------------------------------------------------------------------------- /dlmonitor/webapp/static/mobile.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 994px) { 2 | /* CSS goes here */ 3 | .menu { 4 | display: none; 5 | } 6 | .logo h1{ 7 | font-size: 12px; 8 | text-align: center; 9 | } 10 | .keyword-group input, .keyword-group button{ 11 | height: 22px; 12 | font-size: 12px; 13 | line-height: 0.3; 14 | } 15 | .post-columns .column { 16 | float: none; 17 | width: auto; 18 | } 19 | .post-columns-frame { 20 | height: auto; 21 | overflow-x: auto; 22 | overflow-y: auto; 23 | } 24 | .post-columns { 25 | width: auto; 26 | height: auto; 27 | } 28 | 29 | .preview .panel { 30 | width: 100%; 31 | } 32 | 33 | .mendeley-box { 34 | padding-left: 60%; 35 | width: 100%; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About - Deep Learning Monitor 6 | 7 | 8 | 9 | 10 | 11 | 13 | 15 | 17 | 19 | 21 | 22 | 23 |
24 | 41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 |

49 | Never in history have so many influential academic papers and news coming out every single day. It's time-consuming for researchers to keep their mind up-to-date. This simple project aims to help you to focus on your own research while monitoring the research field you care about. 50 |

51 |

52 | Depending on your own working style, you can create some monitors with the keywords related to your topic and check the new things every one or two weeks. Once you find a good paper, you can directly send it to your Mendeley or Evernote account. This site is also mobile-friendly, so that you can check them on your mobile device. 53 |

54 |

55 | Full-text search helps you to search through the content of massive deep learning papers. This feature is helpful when you write a paper. 56 |

57 |

58 | This project is inspired by arxiv-sanity.com made by Andrej Karpathy, and also semanticscholar.org. Please also check them if you want to make your research more efficient. 59 |

60 |

61 | Source Code: https://github.com/zomux/dlmonitor 62 |

63 |

64 | Raphael Shu, 2017 65 |

66 |
71 |
72 |
73 |
74 |
75 |
76 | 79 |
80 | {% include 'track.html' %} 81 | 82 | 83 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deep Learning Monitor - Find new Arxiv papers, tweets and Reddit posts for you 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 83 | 84 | 105 |
106 |
107 |
108 | {% for src, kw, posts in columns %} 109 |
110 |
111 |
112 |

{{ kw }}

113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 |
123 |
124 | {% include 'post_'+src+'.html' %} 125 |
126 |
127 |
128 | {% endfor %} 129 |
130 |
131 |
132 | 145 | 146 |
147 | 148 | 151 | {% include 'track.html' %} 152 | 153 | 154 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/post_arxiv.html: -------------------------------------------------------------------------------- 1 | {% for post in posts %} 2 |
3 | 4 |
{{ post.authors }}
5 |
6 | 7 | {{ post.published_time.strftime('%Y-%m-%d') }} 8 | 9 | {% if ma_authorized %} 10 | 11 | {% else %} 12 | 13 | {% endif %} 14 | {% if post.popularity > 50 %} 15 | Super Hot 16 | {% elif post.popularity > 3 %} 17 | Hot 18 | {% endif %} 19 | 20 |
21 |
22 |
23 | {% endfor %} 24 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/post_twitter.html: -------------------------------------------------------------------------------- 1 | {% for post in posts %} 2 |
3 | 4 |
{{ post.href_text | safe }}
5 |
6 | 7 | {{ post.published_time.strftime('%Y-%m-%d') }} 8 | 9 | 10 | {% if post.popularity > 500 %} 11 | Super Hot 12 | {% elif post.popularity > 100 %} 13 | Hot 14 | {% endif %} 15 | 16 |
17 |
18 |
19 | {% endfor %} 20 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Full-text Search - Deep Learning Monitor 6 | 7 | 8 | 9 | 10 | 11 | 13 | 15 | 17 | 19 | 21 | 22 | 23 |
24 | 41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 |

49 | This feature will be finished soon. 50 |

51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | {% include 'track.html' %} 59 | 60 | 61 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/single.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{post.title}} - Paper Detail 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 18 | 20 | 22 | 23 | 25 | 26 | 27 |
28 | 45 |
46 |
47 |
48 |
49 |

{{ post.title }}

50 |
    51 |
  • {{ post.published_time }}
  • 52 |
  • {{ post.authors }}
  • 53 |
  • {{ post.popularity }}
  • 54 |
55 |
56 |

Abstract

57 |

{{ post.abstract }}

58 |

 

59 |

Quick Read (beta)

60 |
61 | {% if html_body == "NOT_AVAILABE" %} 62 | This feature is not avaialbe for this paper. 63 | {% elif html_body == "NOT_EXIST" or html_body == "PROCESSING" %} 64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | loading the full paper ... 72 |
73 | {% else %} 74 | {{ html_body|safe }} 75 | {% endif %} 76 |
77 |
82 |
83 |
84 | 102 |
103 |
104 |
105 | {% if html_body == "NOT_EXIST" or html_body == "PROCESSING" %} 106 | 119 | {% endif %} 120 | {% include 'track.html' %} 121 | 122 | 123 | -------------------------------------------------------------------------------- /dlmonitor/webapp/templates/track.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zomux/dlmonitor/edfd5b92a9241b22f5940437a32213a3021f097c/models/.keep -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | arxiv 2 | sqlalchemy == 1.1.10 3 | python-dotenv == 0.6.4 4 | flask == 0.12.2 5 | psycopg2 == 2.7.1 6 | SQLAlchemy-Searchable == 0.10.3 7 | python-twitter == 3.3 8 | praw == 4.5.1 9 | gunicorn == 19.7.1 10 | supervisor == 3.3.1 11 | six == 1.10.0 12 | alembic == 0.9.2 13 | mendeley == 0.3.2 14 | pyopenssl == 19.0.0 -------------------------------------------------------------------------------- /tests/test_arxiv_fetch.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.sources.arxivsrc import ArxivSource 4 | 5 | if __name__ == '__main__': 6 | src = ArxivSource() 7 | src.fetch_new() 8 | -------------------------------------------------------------------------------- /tests/test_arxiv_get.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.sources.arxivsrc import ArxivSource 4 | from dlmonitor.db import close_global_session 5 | 6 | if __name__ == '__main__': 7 | src = ArxivSource() 8 | for post in src.get_posts(num=5): 9 | print post.arxiv_url 10 | print post.title 11 | close_global_session() 12 | -------------------------------------------------------------------------------- /tests/test_pdf_analyzer.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.analyzer import PDFAnalyzer 4 | from argparse import ArgumentParser 5 | 6 | if __name__ == '__main__': 7 | ap = ArgumentParser() 8 | ap.add_argument("path") 9 | args = ap.parse_args() 10 | 11 | print (PDFAnalyzer().run(args.path)) 12 | -------------------------------------------------------------------------------- /tests/test_praw.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.settings import * 4 | import praw 5 | 6 | reddit = praw.Reddit(client_id='ognB0CMmO7EHRg', 7 | client_secret='3G_pCLD9-m49Wk5A4Ut7wBHCIt8', 8 | password='gx041136', 9 | user_agent='dlmonitor', 10 | username='zomux') 11 | posts = reddit.subreddit("MachineLearning").search("Concrete Dropout") 12 | for p in posts: 13 | import pdb;pdb.set_trace() 14 | print p 15 | -------------------------------------------------------------------------------- /tests/test_twitter_api.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append(".") 3 | from dlmonitor.settings import * 4 | import twitter 5 | 6 | tw = twitter.Api(consumer_key=TWITTER_CONSUMER_KEY, consumer_secret=TWITTER_CONSUMER_SECRET, 7 | access_token_key=TWITTER_ACCESS_TOKEN, access_token_secret=TWITTER_ACCESS_SECRET) 8 | # print 'q=%22Pre-Translation for Neural Machine Translation%22' 9 | # print tw.GetSearch(term='#deeplearning', result_type = 'mixed', count=200) 10 | # tw.GetUserTimeline(screen_name="deeplearninghub", count=200): 11 | for post in tw.GetSearch(term='arxiv.org', result_type = 'mixed', count=200): 12 | print post.user.screen_name 13 | print post.created_at 14 | print post.id_str 15 | print post.favorite_count 16 | print post.text 17 | pic_url = None 18 | if post.media: 19 | for media in post.media: 20 | if media.type == 'photo': 21 | pic_url = media.media_url_https 22 | break 23 | for url in post.urls: 24 | print url.url, url.expanded_url 25 | print "---" 26 | --------------------------------------------------------------------------------