├── .gitignore ├── LICENSE.md ├── README.md ├── docs └── screenshots │ ├── 1.png │ └── 2.png ├── setup.py └── tweetsmapper ├── __init__.py ├── resources ├── css │ ├── legend.css │ ├── location-tabs.css │ ├── markercluster.css │ ├── misc.css │ ├── popup.css │ └── tweet-tab.css ├── img │ └── marker.png ├── js │ └── create_cluster_icon.js └── templates │ ├── coordinates-tab.html.j2 │ ├── legend.html.j2 │ ├── place-tab.html.j2 │ ├── popup.html.j2 │ └── tweet.html.j2 ├── run.py └── utils ├── __init__.py ├── api.py ├── args_check.py ├── display.py ├── import_file.py ├── map.py ├── results.py ├── scrape.py └── services.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | .venv 3 | tweetsmapper.egg-info 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ### GNU GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright (C) 2007 Free Software Foundation, Inc. 6 | 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | ### Preamble 12 | 13 | The GNU General Public License is a free, copyleft license for 14 | software and other kinds of works. 15 | 16 | The licenses for most software and other practical works are designed 17 | to take away your freedom to share and change the works. By contrast, 18 | the GNU General Public License is intended to guarantee your freedom 19 | to share and change all versions of a program--to make sure it remains 20 | free software for all its users. We, the Free Software Foundation, use 21 | the GNU General Public License for most of our software; it applies 22 | also to any other work released this way by its authors. You can apply 23 | it to your programs, too. 24 | 25 | When we speak of free software, we are referring to freedom, not 26 | price. Our General Public Licenses are designed to make sure that you 27 | have the freedom to distribute copies of free software (and charge for 28 | them if you wish), that you receive source code or can get it if you 29 | want it, that you can change the software or use pieces of it in new 30 | free programs, and that you know you can do these things. 31 | 32 | To protect your rights, we need to prevent others from denying you 33 | these rights or asking you to surrender the rights. Therefore, you 34 | have certain responsibilities if you distribute copies of the 35 | software, or if you modify it: responsibilities to respect the freedom 36 | of others. 37 | 38 | For example, if you distribute copies of such a program, whether 39 | gratis or for a fee, you must pass on to the recipients the same 40 | freedoms that you received. You must make sure that they, too, receive 41 | or can get the source code. And you must show them these terms so they 42 | know their rights. 43 | 44 | Developers that use the GNU GPL protect your rights with two steps: 45 | (1) assert copyright on the software, and (2) offer you this License 46 | giving you legal permission to copy, distribute and/or modify it. 47 | 48 | For the developers' and authors' protection, the GPL clearly explains 49 | that there is no warranty for this free software. For both users' and 50 | authors' sake, the GPL requires that modified versions be marked as 51 | changed, so that their problems will not be attributed erroneously to 52 | authors of previous versions. 53 | 54 | Some devices are designed to deny users access to install or run 55 | modified versions of the software inside them, although the 56 | manufacturer can do so. This is fundamentally incompatible with the 57 | aim of protecting users' freedom to change the software. The 58 | systematic pattern of such abuse occurs in the area of products for 59 | individuals to use, which is precisely where it is most unacceptable. 60 | Therefore, we have designed this version of the GPL to prohibit the 61 | practice for those products. If such problems arise substantially in 62 | other domains, we stand ready to extend this provision to those 63 | domains in future versions of the GPL, as needed to protect the 64 | freedom of users. 65 | 66 | Finally, every program is threatened constantly by software patents. 67 | States should not allow patents to restrict development and use of 68 | software on general-purpose computers, but in those that do, we wish 69 | to avoid the special danger that patents applied to a free program 70 | could make it effectively proprietary. To prevent this, the GPL 71 | assures that patents cannot be used to render the program non-free. 72 | 73 | The precise terms and conditions for copying, distribution and 74 | modification follow. 75 | 76 | ### TERMS AND CONDITIONS 77 | 78 | #### 0. Definitions. 79 | 80 | "This License" refers to version 3 of the GNU General Public License. 81 | 82 | "Copyright" also means copyright-like laws that apply to other kinds 83 | of works, such as semiconductor masks. 84 | 85 | "The Program" refers to any copyrightable work licensed under this 86 | License. Each licensee is addressed as "you". "Licensees" and 87 | "recipients" may be individuals or organizations. 88 | 89 | To "modify" a work means to copy from or adapt all or part of the work 90 | in a fashion requiring copyright permission, other than the making of 91 | an exact copy. The resulting work is called a "modified version" of 92 | the earlier work or a work "based on" the earlier work. 93 | 94 | A "covered work" means either the unmodified Program or a work based 95 | on the Program. 96 | 97 | To "propagate" a work means to do anything with it that, without 98 | permission, would make you directly or secondarily liable for 99 | infringement under applicable copyright law, except executing it on a 100 | computer or modifying a private copy. Propagation includes copying, 101 | distribution (with or without modification), making available to the 102 | public, and in some countries other activities as well. 103 | 104 | To "convey" a work means any kind of propagation that enables other 105 | parties to make or receive copies. Mere interaction with a user 106 | through a computer network, with no transfer of a copy, is not 107 | conveying. 108 | 109 | An interactive user interface displays "Appropriate Legal Notices" to 110 | the extent that it includes a convenient and prominently visible 111 | feature that (1) displays an appropriate copyright notice, and (2) 112 | tells the user that there is no warranty for the work (except to the 113 | extent that warranties are provided), that licensees may convey the 114 | work under this License, and how to view a copy of this License. If 115 | the interface presents a list of user commands or options, such as a 116 | menu, a prominent item in the list meets this criterion. 117 | 118 | #### 1. Source Code. 119 | 120 | The "source code" for a work means the preferred form of the work for 121 | making modifications to it. "Object code" means any non-source form of 122 | a work. 123 | 124 | A "Standard Interface" means an interface that either is an official 125 | standard defined by a recognized standards body, or, in the case of 126 | interfaces specified for a particular programming language, one that 127 | is widely used among developers working in that language. 128 | 129 | The "System Libraries" of an executable work include anything, other 130 | than the work as a whole, that (a) is included in the normal form of 131 | packaging a Major Component, but which is not part of that Major 132 | Component, and (b) serves only to enable use of the work with that 133 | Major Component, or to implement a Standard Interface for which an 134 | implementation is available to the public in source code form. A 135 | "Major Component", in this context, means a major essential component 136 | (kernel, window system, and so on) of the specific operating system 137 | (if any) on which the executable work runs, or a compiler used to 138 | produce the work, or an object code interpreter used to run it. 139 | 140 | The "Corresponding Source" for a work in object code form means all 141 | the source code needed to generate, install, and (for an executable 142 | work) run the object code and to modify the work, including scripts to 143 | control those activities. However, it does not include the work's 144 | System Libraries, or general-purpose tools or generally available free 145 | programs which are used unmodified in performing those activities but 146 | which are not part of the work. For example, Corresponding Source 147 | includes interface definition files associated with source files for 148 | the work, and the source code for shared libraries and dynamically 149 | linked subprograms that the work is specifically designed to require, 150 | such as by intimate data communication or control flow between those 151 | subprograms and other parts of the work. 152 | 153 | The Corresponding Source need not include anything that users can 154 | regenerate automatically from other parts of the Corresponding Source. 155 | 156 | The Corresponding Source for a work in source code form is that same 157 | work. 158 | 159 | #### 2. Basic Permissions. 160 | 161 | All rights granted under this License are granted for the term of 162 | copyright on the Program, and are irrevocable provided the stated 163 | conditions are met. This License explicitly affirms your unlimited 164 | permission to run the unmodified Program. The output from running a 165 | covered work is covered by this License only if the output, given its 166 | content, constitutes a covered work. This License acknowledges your 167 | rights of fair use or other equivalent, as provided by copyright law. 168 | 169 | You may make, run and propagate covered works that you do not convey, 170 | without conditions so long as your license otherwise remains in force. 171 | You may convey covered works to others for the sole purpose of having 172 | them make modifications exclusively for you, or provide you with 173 | facilities for running those works, provided that you comply with the 174 | terms of this License in conveying all material for which you do not 175 | control copyright. Those thus making or running the covered works for 176 | you must do so exclusively on your behalf, under your direction and 177 | control, on terms that prohibit them from making any copies of your 178 | copyrighted material outside their relationship with you. 179 | 180 | Conveying under any other circumstances is permitted solely under the 181 | conditions stated below. Sublicensing is not allowed; section 10 makes 182 | it unnecessary. 183 | 184 | #### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 185 | 186 | No covered work shall be deemed part of an effective technological 187 | measure under any applicable law fulfilling obligations under article 188 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 189 | similar laws prohibiting or restricting circumvention of such 190 | measures. 191 | 192 | When you convey a covered work, you waive any legal power to forbid 193 | circumvention of technological measures to the extent such 194 | circumvention is effected by exercising rights under this License with 195 | respect to the covered work, and you disclaim any intention to limit 196 | operation or modification of the work as a means of enforcing, against 197 | the work's users, your or third parties' legal rights to forbid 198 | circumvention of technological measures. 199 | 200 | #### 4. Conveying Verbatim Copies. 201 | 202 | You may convey verbatim copies of the Program's source code as you 203 | receive it, in any medium, provided that you conspicuously and 204 | appropriately publish on each copy an appropriate copyright notice; 205 | keep intact all notices stating that this License and any 206 | non-permissive terms added in accord with section 7 apply to the code; 207 | keep intact all notices of the absence of any warranty; and give all 208 | recipients a copy of this License along with the Program. 209 | 210 | You may charge any price or no price for each copy that you convey, 211 | and you may offer support or warranty protection for a fee. 212 | 213 | #### 5. Conveying Modified Source Versions. 214 | 215 | You may convey a work based on the Program, or the modifications to 216 | produce it from the Program, in the form of source code under the 217 | terms of section 4, provided that you also meet all of these 218 | conditions: 219 | 220 | - a) The work must carry prominent notices stating that you modified 221 | it, and giving a relevant date. 222 | - b) The work must carry prominent notices stating that it is 223 | released under this License and any conditions added under 224 | section 7. This requirement modifies the requirement in section 4 225 | to "keep intact all notices". 226 | - c) You must license the entire work, as a whole, under this 227 | License to anyone who comes into possession of a copy. This 228 | License will therefore apply, along with any applicable section 7 229 | additional terms, to the whole of the work, and all its parts, 230 | regardless of how they are packaged. This License gives no 231 | permission to license the work in any other way, but it does not 232 | invalidate such permission if you have separately received it. 233 | - d) If the work has interactive user interfaces, each must display 234 | Appropriate Legal Notices; however, if the Program has interactive 235 | interfaces that do not display Appropriate Legal Notices, your 236 | work need not make them do so. 237 | 238 | A compilation of a covered work with other separate and independent 239 | works, which are not by their nature extensions of the covered work, 240 | and which are not combined with it such as to form a larger program, 241 | in or on a volume of a storage or distribution medium, is called an 242 | "aggregate" if the compilation and its resulting copyright are not 243 | used to limit the access or legal rights of the compilation's users 244 | beyond what the individual works permit. Inclusion of a covered work 245 | in an aggregate does not cause this License to apply to the other 246 | parts of the aggregate. 247 | 248 | #### 6. Conveying Non-Source Forms. 249 | 250 | You may convey a covered work in object code form under the terms of 251 | sections 4 and 5, provided that you also convey the machine-readable 252 | Corresponding Source under the terms of this License, in one of these 253 | ways: 254 | 255 | - a) Convey the object code in, or embodied in, a physical product 256 | (including a physical distribution medium), accompanied by the 257 | Corresponding Source fixed on a durable physical medium 258 | customarily used for software interchange. 259 | - b) Convey the object code in, or embodied in, a physical product 260 | (including a physical distribution medium), accompanied by a 261 | written offer, valid for at least three years and valid for as 262 | long as you offer spare parts or customer support for that product 263 | model, to give anyone who possesses the object code either (1) a 264 | copy of the Corresponding Source for all the software in the 265 | product that is covered by this License, on a durable physical 266 | medium customarily used for software interchange, for a price no 267 | more than your reasonable cost of physically performing this 268 | conveying of source, or (2) access to copy the Corresponding 269 | Source from a network server at no charge. 270 | - c) Convey individual copies of the object code with a copy of the 271 | written offer to provide the Corresponding Source. This 272 | alternative is allowed only occasionally and noncommercially, and 273 | only if you received the object code with such an offer, in accord 274 | with subsection 6b. 275 | - d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | - e) Convey the object code using peer-to-peer transmission, 288 | provided you inform other peers where the object code and 289 | Corresponding Source of the work are being offered to the general 290 | public at no charge under subsection 6d. 291 | 292 | A separable portion of the object code, whose source code is excluded 293 | from the Corresponding Source as a System Library, need not be 294 | included in conveying the object code work. 295 | 296 | A "User Product" is either (1) a "consumer product", which means any 297 | tangible personal property which is normally used for personal, 298 | family, or household purposes, or (2) anything designed or sold for 299 | incorporation into a dwelling. In determining whether a product is a 300 | consumer product, doubtful cases shall be resolved in favor of 301 | coverage. For a particular product received by a particular user, 302 | "normally used" refers to a typical or common use of that class of 303 | product, regardless of the status of the particular user or of the way 304 | in which the particular user actually uses, or expects or is expected 305 | to use, the product. A product is a consumer product regardless of 306 | whether the product has substantial commercial, industrial or 307 | non-consumer uses, unless such uses represent the only significant 308 | mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to 312 | install and execute modified versions of a covered work in that User 313 | Product from a modified version of its Corresponding Source. The 314 | information must suffice to ensure that the continued functioning of 315 | the modified object code is in no case prevented or interfered with 316 | solely because modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or 331 | updates for a work that has been modified or installed by the 332 | recipient, or for the User Product in which it has been modified or 333 | installed. Access to a network may be denied when the modification 334 | itself materially and adversely affects the operation of the network 335 | or violates the rules and protocols for communication across the 336 | network. 337 | 338 | Corresponding Source conveyed, and Installation Information provided, 339 | in accord with this section must be in a format that is publicly 340 | documented (and with an implementation available to the public in 341 | source code form), and must require no special password or key for 342 | unpacking, reading or copying. 343 | 344 | #### 7. Additional Terms. 345 | 346 | "Additional permissions" are terms that supplement the terms of this 347 | License by making exceptions from one or more of its conditions. 348 | Additional permissions that are applicable to the entire Program shall 349 | be treated as though they were included in this License, to the extent 350 | that they are valid under applicable law. If additional permissions 351 | apply only to part of the Program, that part may be used separately 352 | under those permissions, but the entire Program remains governed by 353 | this License without regard to the additional permissions. 354 | 355 | When you convey a copy of a covered work, you may at your option 356 | remove any additional permissions from that copy, or from any part of 357 | it. (Additional permissions may be written to require their own 358 | removal in certain cases when you modify the work.) You may place 359 | additional permissions on material, added by you to a covered work, 360 | for which you have or can give appropriate copyright permission. 361 | 362 | Notwithstanding any other provision of this License, for material you 363 | add to a covered work, you may (if authorized by the copyright holders 364 | of that material) supplement the terms of this License with terms: 365 | 366 | - a) Disclaiming warranty or limiting liability differently from the 367 | terms of sections 15 and 16 of this License; or 368 | - b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | - c) Prohibiting misrepresentation of the origin of that material, 372 | or requiring that modified versions of such material be marked in 373 | reasonable ways as different from the original version; or 374 | - d) Limiting the use for publicity purposes of names of licensors 375 | or authors of the material; or 376 | - e) Declining to grant rights under trademark law for use of some 377 | trade names, trademarks, or service marks; or 378 | - f) Requiring indemnification of licensors and authors of that 379 | material by anyone who conveys the material (or modified versions 380 | of it) with contractual assumptions of liability to the recipient, 381 | for any liability that these contractual assumptions directly 382 | impose on those licensors and authors. 383 | 384 | All other non-permissive additional terms are considered "further 385 | restrictions" within the meaning of section 10. If the Program as you 386 | received it, or any part of it, contains a notice stating that it is 387 | governed by this License along with a term that is a further 388 | restriction, you may remove that term. If a license document contains 389 | a further restriction but permits relicensing or conveying under this 390 | License, you may add to a covered work material governed by the terms 391 | of that license document, provided that the further restriction does 392 | not survive such relicensing or conveying. 393 | 394 | If you add terms to a covered work in accord with this section, you 395 | must place, in the relevant source files, a statement of the 396 | additional terms that apply to those files, or a notice indicating 397 | where to find the applicable terms. 398 | 399 | Additional terms, permissive or non-permissive, may be stated in the 400 | form of a separately written license, or stated as exceptions; the 401 | above requirements apply either way. 402 | 403 | #### 8. Termination. 404 | 405 | You may not propagate or modify a covered work except as expressly 406 | provided under this License. Any attempt otherwise to propagate or 407 | modify it is void, and will automatically terminate your rights under 408 | this License (including any patent licenses granted under the third 409 | paragraph of section 11). 410 | 411 | However, if you cease all violation of this License, then your license 412 | from a particular copyright holder is reinstated (a) provisionally, 413 | unless and until the copyright holder explicitly and finally 414 | terminates your license, and (b) permanently, if the copyright holder 415 | fails to notify you of the violation by some reasonable means prior to 416 | 60 days after the cessation. 417 | 418 | Moreover, your license from a particular copyright holder is 419 | reinstated permanently if the copyright holder notifies you of the 420 | violation by some reasonable means, this is the first time you have 421 | received notice of violation of this License (for any work) from that 422 | copyright holder, and you cure the violation prior to 30 days after 423 | your receipt of the notice. 424 | 425 | Termination of your rights under this section does not terminate the 426 | licenses of parties who have received copies or rights from you under 427 | this License. If your rights have been terminated and not permanently 428 | reinstated, you do not qualify to receive new licenses for the same 429 | material under section 10. 430 | 431 | #### 9. Acceptance Not Required for Having Copies. 432 | 433 | You are not required to accept this License in order to receive or run 434 | a copy of the Program. Ancillary propagation of a covered work 435 | occurring solely as a consequence of using peer-to-peer transmission 436 | to receive a copy likewise does not require acceptance. However, 437 | nothing other than this License grants you permission to propagate or 438 | modify any covered work. These actions infringe copyright if you do 439 | not accept this License. Therefore, by modifying or propagating a 440 | covered work, you indicate your acceptance of this License to do so. 441 | 442 | #### 10. Automatic Licensing of Downstream Recipients. 443 | 444 | Each time you convey a covered work, the recipient automatically 445 | receives a license from the original licensors, to run, modify and 446 | propagate that work, subject to this License. You are not responsible 447 | for enforcing compliance by third parties with this License. 448 | 449 | An "entity transaction" is a transaction transferring control of an 450 | organization, or substantially all assets of one, or subdividing an 451 | organization, or merging organizations. If propagation of a covered 452 | work results from an entity transaction, each party to that 453 | transaction who receives a copy of the work also receives whatever 454 | licenses to the work the party's predecessor in interest had or could 455 | give under the previous paragraph, plus a right to possession of the 456 | Corresponding Source of the work from the predecessor in interest, if 457 | the predecessor has it or can get it with reasonable efforts. 458 | 459 | You may not impose any further restrictions on the exercise of the 460 | rights granted or affirmed under this License. For example, you may 461 | not impose a license fee, royalty, or other charge for exercise of 462 | rights granted under this License, and you may not initiate litigation 463 | (including a cross-claim or counterclaim in a lawsuit) alleging that 464 | any patent claim is infringed by making, using, selling, offering for 465 | sale, or importing the Program or any portion of it. 466 | 467 | #### 11. Patents. 468 | 469 | A "contributor" is a copyright holder who authorizes use under this 470 | License of the Program or a work on which the Program is based. The 471 | work thus licensed is called the contributor's "contributor version". 472 | 473 | A contributor's "essential patent claims" are all patent claims owned 474 | or controlled by the contributor, whether already acquired or 475 | hereafter acquired, that would be infringed by some manner, permitted 476 | by this License, of making, using, or selling its contributor version, 477 | but do not include claims that would be infringed only as a 478 | consequence of further modification of the contributor version. For 479 | purposes of this definition, "control" includes the right to grant 480 | patent sublicenses in a manner consistent with the requirements of 481 | this License. 482 | 483 | Each contributor grants you a non-exclusive, worldwide, royalty-free 484 | patent license under the contributor's essential patent claims, to 485 | make, use, sell, offer for sale, import and otherwise run, modify and 486 | propagate the contents of its contributor version. 487 | 488 | In the following three paragraphs, a "patent license" is any express 489 | agreement or commitment, however denominated, not to enforce a patent 490 | (such as an express permission to practice a patent or covenant not to 491 | sue for patent infringement). To "grant" such a patent license to a 492 | party means to make such an agreement or commitment not to enforce a 493 | patent against the party. 494 | 495 | If you convey a covered work, knowingly relying on a patent license, 496 | and the Corresponding Source of the work is not available for anyone 497 | to copy, free of charge and under the terms of this License, through a 498 | publicly available network server or other readily accessible means, 499 | then you must either (1) cause the Corresponding Source to be so 500 | available, or (2) arrange to deprive yourself of the benefit of the 501 | patent license for this particular work, or (3) arrange, in a manner 502 | consistent with the requirements of this License, to extend the patent 503 | license to downstream recipients. "Knowingly relying" means you have 504 | actual knowledge that, but for the patent license, your conveying the 505 | covered work in a country, or your recipient's use of the covered work 506 | in a country, would infringe one or more identifiable patents in that 507 | country that you have reason to believe are valid. 508 | 509 | If, pursuant to or in connection with a single transaction or 510 | arrangement, you convey, or propagate by procuring conveyance of, a 511 | covered work, and grant a patent license to some of the parties 512 | receiving the covered work authorizing them to use, propagate, modify 513 | or convey a specific copy of the covered work, then the patent license 514 | you grant is automatically extended to all recipients of the covered 515 | work and works based on it. 516 | 517 | A patent license is "discriminatory" if it does not include within the 518 | scope of its coverage, prohibits the exercise of, or is conditioned on 519 | the non-exercise of one or more of the rights that are specifically 520 | granted under this License. You may not convey a covered work if you 521 | are a party to an arrangement with a third party that is in the 522 | business of distributing software, under which you make payment to the 523 | third party based on the extent of your activity of conveying the 524 | work, and under which the third party grants, to any of the parties 525 | who would receive the covered work from you, a discriminatory patent 526 | license (a) in connection with copies of the covered work conveyed by 527 | you (or copies made from those copies), or (b) primarily for and in 528 | connection with specific products or compilations that contain the 529 | covered work, unless you entered into that arrangement, or that patent 530 | license was granted, prior to 28 March 2007. 531 | 532 | Nothing in this License shall be construed as excluding or limiting 533 | any implied license or other defenses to infringement that may 534 | otherwise be available to you under applicable patent law. 535 | 536 | #### 12. No Surrender of Others' Freedom. 537 | 538 | If conditions are imposed on you (whether by court order, agreement or 539 | otherwise) that contradict the conditions of this License, they do not 540 | excuse you from the conditions of this License. If you cannot convey a 541 | covered work so as to satisfy simultaneously your obligations under 542 | this License and any other pertinent obligations, then as a 543 | consequence you may not convey it at all. For example, if you agree to 544 | terms that obligate you to collect a royalty for further conveying 545 | from those to whom you convey the Program, the only way you could 546 | satisfy both those terms and this License would be to refrain entirely 547 | from conveying the Program. 548 | 549 | #### 13. Use with the GNU Affero General Public License. 550 | 551 | Notwithstanding any other provision of this License, you have 552 | permission to link or combine any covered work with a work licensed 553 | under version 3 of the GNU Affero General Public License into a single 554 | combined work, and to convey the resulting work. The terms of this 555 | License will continue to apply to the part which is the covered work, 556 | but the special requirements of the GNU Affero General Public License, 557 | section 13, concerning interaction through a network will apply to the 558 | combination as such. 559 | 560 | #### 14. Revised Versions of this License. 561 | 562 | The Free Software Foundation may publish revised and/or new versions 563 | of the GNU General Public License from time to time. Such new versions 564 | will be similar in spirit to the present version, but may differ in 565 | detail to address new problems or concerns. 566 | 567 | Each version is given a distinguishing version number. If the Program 568 | specifies that a certain numbered version of the GNU General Public 569 | License "or any later version" applies to it, you have the option of 570 | following the terms and conditions either of that numbered version or 571 | of any later version published by the Free Software Foundation. If the 572 | Program does not specify a version number of the GNU General Public 573 | License, you may choose any version ever published by the Free 574 | Software Foundation. 575 | 576 | If the Program specifies that a proxy can decide which future versions 577 | of the GNU General Public License can be used, that proxy's public 578 | statement of acceptance of a version permanently authorizes you to 579 | choose that version for the Program. 580 | 581 | Later license versions may give you additional or different 582 | permissions. However, no additional obligations are imposed on any 583 | author or copyright holder as a result of your choosing to follow a 584 | later version. 585 | 586 | #### 15. Disclaimer of Warranty. 587 | 588 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 589 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 590 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 591 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 592 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 593 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 594 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 595 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR 596 | CORRECTION. 597 | 598 | #### 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR 602 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 603 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 604 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT 605 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR 606 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM 607 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 608 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 609 | 610 | #### 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | ### How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these 626 | terms. 627 | 628 | To do so, attach the following notices to the program. It is safest to 629 | attach them to the start of each source file to most effectively state 630 | the exclusion of warranty; and each file should have at least the 631 | "copyright" line and a pointer to where the full notice is found. 632 | 633 | 634 | Copyright (C) 635 | 636 | This program is free software: you can redistribute it and/or modify 637 | it under the terms of the GNU General Public License as published by 638 | the Free Software Foundation, either version 3 of the License, or 639 | (at your option) any later version. 640 | 641 | This program is distributed in the hope that it will be useful, 642 | but WITHOUT ANY WARRANTY; without even the implied warranty of 643 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 644 | GNU General Public License for more details. 645 | 646 | You should have received a copy of the GNU General Public License 647 | along with this program. If not, see . 648 | 649 | Also add information on how to contact you by electronic and paper 650 | mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands \`show w' and \`show c' should show the 661 | appropriate parts of the General Public License. Of course, your 662 | program's commands might be different; for a GUI interface, you would 663 | use an "about box". 664 | 665 | You should also get your employer (if you work as a programmer) or 666 | school, if any, to sign a "copyright disclaimer" for the program, if 667 | necessary. For more information on this, and how to apply and follow 668 | the GNU GPL, see . 669 | 670 | The GNU General Public License does not permit incorporating your 671 | program into proprietary programs. If your program is a subroutine 672 | library, you may consider it more useful to permit linking proprietary 673 | applications with the library. If this is what you want to do, use the 674 | GNU Lesser General Public License instead of this License. But first, 675 | please read . 676 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tweetsmapper 2 | 3 | tweetsmapper is a command-line Twitter geo intelligence tool. It generates a [Leaflet](https://leafletjs.com/) map for a given user or from an existing collection of tweets. 4 | 5 | ## Screenshots & Demo 6 | 7 | Click on a screenshot to browse the demo map: 8 | 9 | Screenshot 1 10 | Screenshot 2 11 | 12 | 13 | ## Features 14 | - Download a user's tweets via the API and generate a map. 15 | - Retrieve full user timeline by collecting tweet IDs first and hydrating them. 16 | - Map a collection of tweets. Supported formats: 17 | - `.jsonl` file generated with [twarc](https://github.com/DocNow/twarc) 18 | - `.txt` file generated with [Twint](https://github.com/twintproject/twint) (uses the API) 19 | - custom list of tweet IDs in `.txt` format, one ID per line (uses the API) 20 | - Display only tweets with coordinates, only tweets with place, or both. 21 | - Investigate tweet locations on popular mapping services (Google, Yandex, OSM, Wikimapia...) and satellite imagery services (Here, Descartes, Landviewer, Zoom Earth). See [services.py](https://github.com/r3mlab/tweetsmapper/blob/master/tweetsmapper/utils/services.py) for a full list. 22 | 23 | ## Dependencies 24 | - Python >= 3.6 25 | - [tweepy](https://github.com/tweepy/tweepy) 26 | - [twint](https://github.com/twintproject/twint) 27 | - [folium](https://github.com/python-visualization/folium) 28 | - [emoji](https://github.com/carpedm20/emoji/) 29 | - [tqdm](https://github.com/tqdm/tqdm) 30 | - [twitter_text_python](https://github.com/edmondburnett/twitter-text-python) 31 | 32 | ## Setup 33 | 34 | #### Method 1: Git clone & install 35 | ```bash 36 | # Clone the git repository 37 | git clone https://github.com/r3mlab/tweetsmapper.git 38 | # Enter the git respository folder 39 | cd tweetsmapper 40 | # Create a new virtual environment 41 | virtualenv -p /usr/bin/python3 .venv 42 | # Activate it 43 | source .venv/bin/activate 44 | # Install with pip 45 | pip3 install -e . 46 | ``` 47 | Once you are done using tweetsmapper, you should deactivate the virtual environment: 48 | ```bash 49 | deactivate 50 | ``` 51 | 52 | #### Method 2: Direct install with Pip 53 | ```bash 54 | # Create a new virtual environment 55 | virtualenv -p /usr/bin/python3 .venv 56 | # Activate it 57 | source .venv/bin/activate 58 | # Install with pip 59 | pip3 install --upgrade git+https://github.com/r3mlab/tweetsmapper.git@master#egg=tweetsmapper 60 | ``` 61 | Once you are done using tweetsmapper, you should deactivate the virtual environment: 62 | ```bash 63 | deactivate 64 | ``` 65 | 66 | #### Twitter credentials configuration 67 | 68 | To obtain Twitter API credentials: 69 | - Go to https://developer.twitter.com/apps. 70 | - Login & apply for a developer account. Validation can take a few days. 71 | - Create an application. 72 | - Your credentials are in the `Keys & tokens` tab of your application. 73 | 74 | To register these credentials in tweetsmapper, run the following command: 75 | ```bash 76 | tweetsmapper --configure 77 | ``` 78 | 79 | You will be prompted for your credentials one by one. If they are valid, they will be saved to `.tweetsmapper` in your user home folder. You can move this file around and then specify its location passing the `-c` argument. (see [Usage](#usage)) 80 | 81 | Alternatively, you can define the environment variables `CONSUMER_KEY`, `CONSUMER_SECRET`, `ACCESS_TOKEN` and `ACCESS_TOKEN_SECRET`. These would take priority over a configuration file, unless one is specified with `-c`. 82 | 83 | ## Usage 84 | 85 | ``` 86 | usage: tweetsmapper [-h] [-n SCREEN_NAME] [-i INPUT_FILE] [-l N] 87 | [-o OUTPUT_FILE] [-t CUSTOM_TITLE] [--configure] 88 | [-c CONFIG_FILE] 89 | 90 | Generate Leaflet maps from geo-enabled tweets. 91 | 92 | optional arguments: 93 | -h, --help show this help message and exit 94 | -n SCREEN_NAME, --screen-name SCREEN_NAME 95 | Screen name of the user to target (uses the API) 96 | -i INPUT_FILE, --input-file INPUT_FILE 97 | Path to a collection of tweets. Supports: JSONL, TXT 98 | -l N, --limit N Limit the number of tweets to retrieve (default = no 99 | limit) 100 | -o OUTPUT_FILE, --output-path OUTPUT_FILE 101 | Map output file 102 | -t CUSTOM_TITLE, --custom-title CUSTOM_TITLE 103 | Custom HTML title for map legend 104 | --configure Configure Twitter API credentials 105 | -c CONFIG_FILE, --config-path CONFIG_FILE 106 | Path to configuration file 107 | ``` 108 | 109 | #### Usage examples 110 | 111 | **Fetch all tweets for user `@TwitterFrance` and generate a map with the geo-enabled ones:** 112 | ```bash 113 | tweetsmapper -n TwitterFrance 114 | ``` 115 | 116 | **Map all geo-enabled tweets from a `.jsonl` generated with [twarc](https://github.com/DocNow/twarc):** 117 | ```bash 118 | tweetsmapper -i tweets.jsonl 119 | ``` 120 | 121 | **Map all geo-enabled tweets from a list of tweet IDs (1 ID per line):** 122 | ```bash 123 | tweetsmapper -i ids.txt 124 | ``` 125 | *Note: tweets will be hydrated using the API.* 126 | 127 | **Map all geo-enabled tweets from a `.txt` file generated with [Twint](https://github.com/twintproject/twint):** 128 | 129 | ```bash 130 | tweetsmapper -i tweets.txt 131 | ``` 132 | *Note: tweets need to be hydrated using the API: twint can't scrape their precise location as it does not appear on twitter.com.* 133 | 134 | **Others** 135 | 136 | If you want to map more complex searches, use [Twint](https://github.com/twintproject/twint) or [twarc](https://github.com/DocNow/twarc) to create a collection of tweets or tweet IDs that suits your needs, and pass the resulting file to tweetsmapper. 137 | 138 | 139 | ## FAQ 140 | 141 | ### *How precise is the location of a tweet?* 142 | 143 | There are two types of geo-enabled tweets: 144 | 145 | - **Tweets with place**
146 | On every platform, Twitter users can add general location labels called *places* to their tweets. These can be as small as a building, or as big a country. Places location are provided by Foursquare and Yelp. The Twitter API provides the name of the place and the coordinates of a rectangular bounding box enclosing it.
tweetsmapper maps these tweets to the centroid of this bounding box. 147 | 148 | - **Tweets with coordinates**
149 | On Android and iOS, users may also include their current coordinates in a tweet. The Twitter app confusingly names this feature "location", as it does for places. 150 | When coordinates are included in a tweet, Twitter tries to match them to a known place, and displays the place's name on its interfaces. 151 | The coordinates of the tweet, however, can only be obtained through the API. 152 |
tweetsmapper maps these tweets directly to their coordinates. 153 | 154 | ### *Where are elements of the map loaded from ?* 155 | 156 | - Tweets are rendered using an HTML/CSS template. Twitter's JS is not used and not loaded with the map. 157 | - Tweet media & profile pictures are loaded from `twitter.com`. 158 | - Map tiles are loaded from `cartodb.com`. 159 | - Leaflet's JS and CSS are loaded from various CDNs, as per folium's defaults: `cdn.jsdelivr.net`, `code.jquery.com`, `maxcdn.bootstrapcdn.com`, `cdnjs.cloudflare.com`, `rawcdn.githack.com`, `unpkg.com`. 160 | - Emojis are loaded from `twemoji.maxcdn.com` (images only, no JS). 161 | 162 | This allows for the generation of a map that fits into a single `.html` file, and that can be browsed from anywhere with an Internet connection. 163 | This might change in the future to reduce calls to external resources. 164 | 165 | ### *Why this tool?* 166 | 167 | Following privacy concerns, Twitter disabled precise location in tweets by default in April 2015. Unfortunately, precise location data for tweets before this date or for users who opted-in remains, potentially exposing sensible data such as home or work addresses. 168 | 169 | While the coordinates are still attached to the tweets, they do not appear on Twitter's web or mobile interface. They are however available to anyone using the API, be it for research, commercial, or nefarious purposes. 170 | 171 | This tool allows you to easily see what and how much geo information a Twitter account exposes. Results are presented in a simple interactive map with further searching capabilities. It hopes to help raise awareness about online privacy. 172 | 173 | If you are interested about this issue, here are some good reads: 174 | - ["FYI: Twitter's API still spews enough metadata to reveal exactly where you lived, worked"](https://www.theregister.co.uk/2019/01/08/twitter_privacy_problems/) by Thomas Claburn (theregister.co.uk, 8 Jan 2019) 175 | - ["Please Forget Where I Was Last Summer:The Privacy Risks of Public Location (Meta)Data"](https://arxiv.org/pdf/1901.00897.pdf) by Kostas Drakonakis, Panagiotis Ilia, Sotiris Ioannidis, Jason Polakis (arxiv.org, 3 Jan 2019) 176 | 177 | 178 | ### *Can I remove the precise location from my tweets?* 179 | 180 | Yes. Using Twitter's web interface, you can remove location data from displaying in all of your past tweets. Check your Privacy and safety settings or refer to [Twitter's documentation on location](https://help.twitter.com/en/using-twitter/tweet-location). 181 | 182 | ## Disclaimers 183 | 184 | TWITTER, TWEET, RETWEET and the Twitter logo are trademarks of Twitter, Inc. or its affiliates. 185 | 186 | Sharing maps made with this tool openly on the web is against Twitter's Developper Policy. If you need to allow access to a collection of tweets, you should only share Tweet IDs or User IDs (cf. [Be a Good Partner with Twitter](https://developer.twitter.com/en/developer-terms/policy)). 187 | 188 | ## License 189 | 190 | This program is free software: you can redistribute it and/or modify it under the terms of the [GNU General Public License](LICENSE.md) as published by the Free Software Foundation. 191 | 192 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](LICENSE.md) for more details. 193 | -------------------------------------------------------------------------------- /docs/screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3mlab/tweetsmapper/7f1fb850b46523ab8d02843b1071d087e07f693b/docs/screenshots/1.png -------------------------------------------------------------------------------- /docs/screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3mlab/tweetsmapper/7f1fb850b46523ab8d02843b1071d087e07f693b/docs/screenshots/2.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (C) 2019 r3mlab 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | 20 | from os import path 21 | from setuptools import setup, find_packages 22 | 23 | here = path.abspath(path.dirname(__file__)) 24 | 25 | # Get the long description from the README file 26 | with open(path.join(here, "README.md"), encoding="utf-8") as f: 27 | long_description = f.read() 28 | 29 | requirements = [ 30 | "folium", 31 | "tweepy", 32 | "twint @ git+https://github.com/twintproject/twint.git@master#egg=twint", 33 | "tqdm", 34 | "twitter_text_python", 35 | "emoji", 36 | ] 37 | 38 | setup( 39 | name="tweetsmapper", 40 | version="1.0", 41 | description="Generate Leaflet maps from geo-enabled tweets.", 42 | long_description_content_type="text/markdown", 43 | url="https://github.com/r3mlab/tweetsmapper", 44 | author="r3mlab", 45 | author_email="remlab@protonmail.com", 46 | packages=find_packages(exclude=["docs"]), 47 | python_requires=">=3.5", 48 | install_requires=requirements, 49 | license="GPLv3", 50 | entry_points={"console_scripts": ["tweetsmapper=tweetsmapper:main"]}, 51 | zip_safe=False, 52 | include_package_data=True, 53 | ) 54 | -------------------------------------------------------------------------------- /tweetsmapper/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | from sys import version_info 22 | from tweetsmapper import run 23 | 24 | 25 | def main(): 26 | """Entry point for the application script.""" 27 | if version_info.major == "2": 28 | print("You appear to be running Python 2. tweetsmapper requires Python 3.") 29 | else: 30 | try: 31 | run.main() 32 | except KeyboardInterrupt: 33 | print("\rExiting tweetsmapper...") 34 | raise SystemExit(1) 35 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/legend.css: -------------------------------------------------------------------------------- 1 | .legend-title-container, 2 | .legend-details { 3 | position: absolute; 4 | z-index: 9999; 5 | font: normal normal 14px/1.4 Helvetica, Roboto, "Segoe UI", Calibri, sans-serif; 6 | width: 260px; 7 | margin-left: 10px; 8 | margin-bottom: 8px; 9 | padding-left: 20px; 10 | padding-right: 20px; 11 | } 12 | 13 | .legend-title-container { 14 | bottom: 107px; 15 | left: 0; 16 | background-color: #fff; 17 | border-radius: 5px; 18 | padding-top: 18px; 19 | } 20 | 21 | .legend-title-container p { 22 | margin-bottom: 5px; 23 | font-weight: bold; 24 | } 25 | 26 | .legend-details { 27 | bottom: 14px; 28 | left: 0; 29 | } 30 | 31 | .legend-title-container a { 32 | color: black; 33 | } 34 | 35 | .legend-details p { 36 | text-align: left; 37 | font-size: 0.6em; 38 | color: #697882; 39 | margin-bottom: 0; 40 | } 41 | 42 | .legend-details p a { 43 | color: #697882; 44 | } 45 | 46 | .legend-title-container a:hover, 47 | .legend-details a:hover { 48 | color: #1DA1F2; 49 | text-decoration: none; 50 | } 51 | 52 | /* Custom Leaflet LayerControl */ 53 | .leaflet-control-layers-expanded { 54 | padding-top: 15px !important; 55 | padding-bottom: 45px !important; 56 | width: 260px; 57 | padding-left: 20px !important; 58 | border: none !important; 59 | border-radius: 5px !important; 60 | background-color: #fff !important; 61 | } 62 | 63 | .leaflet-control-layers-overlays { 64 | font: normal normal 12px/1.5 Helvetica, Roboto, "Segoe UI", Calibri, sans-serif; 65 | color: #1c2022; 66 | font-weight: normal; 67 | } 68 | 69 | label { 70 | font-weight: unset !important; 71 | } 72 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/location-tabs.css: -------------------------------------------------------------------------------- 1 | .location-title { 2 | font-weight: bold; 3 | color: #697882; 4 | margin: 10px 0; 5 | } 6 | 7 | .location-info table { 8 | margin-top: 20px; 9 | } 10 | 11 | .location-info td { 12 | padding-left: 25px; 13 | padding-bottom: 3px 14 | } 15 | 16 | .location-search p { 17 | padding: 0 25px; 18 | line-height: 25px; 19 | color: #697882; 20 | } 21 | 22 | .location-detail { 23 | text-align: right; 24 | } 25 | 26 | .location-search a, 27 | .location-search a:link, 28 | .location-search a:visited { 29 | text-decoration: none; 30 | } 31 | 32 | .location-search a:hover { 33 | color: #1DA1F2; 34 | } 35 | 36 | .services-list { 37 | overflow: hidden; 38 | margin: 0 25px; 39 | line-height: 1.5; 40 | } 41 | 42 | .services-list ul { 43 | list-style-type: none; 44 | padding-left: 0; 45 | } 46 | 47 | .services-list li { 48 | margin: .2em 0; 49 | padding: 0 0.25em; 50 | float: left; 51 | } 52 | 53 | .services-list li:first-of-type { 54 | border-right: 1px solid #e1e8ed; 55 | padding-right: 8px; 56 | margin-right: 8px; 57 | } 58 | 59 | .services-list div { 60 | display: block; 61 | } 62 | 63 | /* LOGOS */ 64 | .service-logo { 65 | width: 16px; 66 | height: 16px; 67 | } 68 | 69 | .bing-logo { 70 | background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='1.414'%3E%3Cpath fill='%23008373' d='M2.404 0L5.6 1.124v11.25l4.502-2.598L7.895 8.74 6.503 5.274l7.093 2.492v3.623L5.602 16l-3.198-1.78z'/%3E%3C/svg%3E"); 71 | } 72 | 73 | .descartes-logo { 74 | background-image: url("data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASLdTQUi3U4BIt1NLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbRR8eSLdTgEi3U4BIt1OASLdTgEi3U4AbRR8JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASLdTREi3U4BIt1OASLdTgEi3U4BIt1OASLdTSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIykPZdwrEbAcKxGwGuhTNtSm1jAUptYwDWUtsgcmfeAHJn3gByZ93wAAAAAAAAAAAAAAAAAAAAAAAAAAL+VLICRozuicKxGwG6hSuBuoUrgbqFK4DOas+A0krrSNYfFwByZ94AcmfeAHJn3gAAAAAAAAAAAAAAAAAAAAAC/lSyAv5UsgHCsRsBuoEvgb45c8G6hSuAzmrPgKW7f4DWGxsEcmfeAHJn3gByZ94AAAAAAAAAAAAAAAAAAAAAAv5UsgL+VLICmX2bAm2Fm4G+OXPBcPK3wNGnb8Clu3+Apbt/gH3DzwByZ94AcmfeAAAAAAAAAAAAAAAAAAAAAAL+VLICxdk6ipl9mwJxfZuB3S4/pXDyt8DRp2/Awa93pKW7f4B9w88AegfWiHJn3gAAAAAAAAAAAAAAAAAAAAAAAAAAAr3JSl6ZfZsCmX2bAdkqR5E8zuuBPM7rgMWfc5B9w88AfcPPAHnz0lwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJlEg0SZRIOAmUSDgGY0saRLK8nASyvJwD0n1aQkHuyAJB7sgCQe7EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5GjEDmUSDgJlEg4CSQoqESyvJwEsrycAoH+mEJB7sgCQe7IAOC1keAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACZRINHmUSDgJlEg0IkHuxLJB7sgCQe7EEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAD9/wAA8H8AAPB/AADgDwAAwAMAAMADAADAAwAAwAMAAOAHAADwDwAA8A8AAP2/AAD//wAA//8AAA=="); 75 | } 76 | 77 | .here-logo { 78 | background-image: url("data:image/svg+xml,%3Csvg id='Ebene_1' data-name='Ebene 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 178.07 168.35'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23383c45;%7D.cls-2%7Bfill:%2363d1be;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Ehere_logo%3C/title%3E%3Cpath class='cls-1' d='M86.8,61C80,60.63,73.68,63.33,68,69a24.16,24.16,0,0,0-5.92,26.72,36.77,36.77,0,0,0,8.59,12.88c6.28,6.28,13.08,9.63,20.23,10s14-2.7,20.38-9a34,34,0,0,0,9.83-20.76l.09-.76-12.57-1.89-.14.76A32,32,0,0,1,106.42,94,16.84,16.84,0,0,1,102.94,99c-2.4,2.4-4.81,3.76-7.33,3.89-2.35.13-5.52-1.41-8.13-3.3L111,76.08l-.51-.64a49.54,49.54,0,0,0-4-4.44C100.22,64.72,93.57,61.32,86.8,61Zm4.28,19.24L79.49,91.81c-3.08-3.69-4.24-6.09-4.56-8.26a6.67,6.67,0,0,1,2.26-5.94C80.88,73.92,85.34,74.68,91.08,80.22Z' transform='translate(-0.61 -3.46)'/%3E%3Cpath class='cls-1' d='M111.92,26.43a20.26,20.26,0,0,0-4.51,3.46,13.48,13.48,0,0,0-3.95,8.69,18.65,18.65,0,0,0,1.17,7.75l-6.35-4.9L87.15,52.57,126.62,92,139,79.64,119.25,59.86c-7.07-7.07-3.22-14.25-1.17-16.3a22.71,22.71,0,0,1,3.86-2.88l.74-.47L112.54,26.1Z' transform='translate(-0.61 -3.46)'/%3E%3Cpath class='cls-1' d='M144.29,3.49c-6.8-.35-13.12,2.36-18.79,8a24.9,24.9,0,0,0-7.18,12.79,25,25,0,0,0,1.26,13.93,36.78,36.78,0,0,0,8.59,12.87c6.28,6.28,13.08,9.63,20.23,10s14-2.69,20.38-9A34,34,0,0,0,178.6,31.3l.09-.76-12.57-1.89-.14.76a32,32,0,0,1-2.07,7.07,16.86,16.86,0,0,1-3.48,5.07c-2.4,2.39-4.81,3.76-7.34,3.89-2.36.12-5.51-1.41-8.13-3.3L168.5,18.59,168,18a49.29,49.29,0,0,0-4-4.45C157.71,7.23,151.05,3.84,144.29,3.49Zm4.28,19.24L137,34.32c-3.08-3.69-4.24-6.09-4.56-8.26a6.68,6.68,0,0,1,2.26-5.94C138.37,16.43,142.83,17.19,148.57,22.73Z' transform='translate(-0.61 -3.46)'/%3E%3Cpath class='cls-1' d='M50.11,93.33c-4.11-.16-7.87,1.45-11.34,4.91a20,20,0,0,0-4.89,7.6,18.86,18.86,0,0,0-1.18,7.31L13.06,93.52.61,106.27l43.68,44.06H69.11l-26.81-27.2c-.74-5.25-.45-8.76,1.61-10.83A3.76,3.76,0,0,1,47,111c1.16.1,2.63,1.11,4.38,2.86l26.76,26.74,12.4-12.42L61.82,99.42C58,95.64,54.2,93.48,50.11,93.33Z' transform='translate(-0.61 -3.46)'/%3E%3Cpolygon class='cls-2' points='0.01 146.45 43.68 146.52 21.85 168.35 0.01 146.45'/%3E%3C/svg%3E"); 79 | } 80 | 81 | .googlemaps-logo { 82 | background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 512 512' style='enable-background:new 0 0 512 512;' xml:space='preserve'%3E%3Ccircle style='fill:%2340A459;' cx='255.722' cy='256' r='255.445'/%3E%3Cpath style='fill:%23378B4E;' d='M255.722,0.555c-1.944,0-3.878,0.03-5.812,0.073c-0.492,0.011-0.983,0.022-1.474,0.037 c-1.843,0.051-3.682,0.119-5.514,0.209c-0.474,0.023-0.945,0.056-1.418,0.081c-1.394,0.077-2.785,0.165-4.174,0.264 c-0.699,0.05-1.397,0.098-2.094,0.153c-1.61,0.128-3.217,0.27-4.82,0.428c-0.829,0.082-1.654,0.173-2.479,0.262 c-0.991,0.108-1.98,0.221-2.968,0.34c-0.856,0.103-1.714,0.202-2.567,0.313c125.334,16.327,222.126,123.498,222.126,253.282 S347.737,492.953,222.403,509.28c0.854,0.111,1.71,0.211,2.567,0.313c0.987,0.119,1.977,0.232,2.968,0.34 c0.826,0.09,1.652,0.181,2.479,0.262c1.603,0.158,3.209,0.3,4.82,0.428c0.696,0.056,1.395,0.104,2.094,0.153 c1.388,0.099,2.779,0.188,4.174,0.264c0.473,0.027,0.945,0.058,1.418,0.081c1.833,0.09,3.672,0.158,5.514,0.209 c0.491,0.014,0.982,0.026,1.474,0.037c1.932,0.043,3.868,0.073,5.812,0.073c141.079,0,255.445-114.367,255.445-255.445 S396.801,0.555,255.722,0.555z'/%3E%3Cpath style='fill:%23898790;' d='M222.403,233.787l106.563-61.152c0,0,116.569,24.829,143.473-24.263l8.485-15.483l7.379,16.04 c15.321,33.304,23.42,70.329,23.42,107.071c0,84.691-41.95,163.833-112.217,211.703l-7.25,4.94L222.403,233.787z'/%3E%3Cpath style='fill:%237A797F;' d='M511.166,256c0-44.143-11.198-85.671-30.908-121.898l-7.82,14.269 c-9.45,17.245-21.888,34.878-34.284,50.741c4.162,18.295,6.374,37.333,6.374,56.888c0,71.337-29.248,135.834-76.4,182.176 l23.852,34.666C463.639,427.598,511.166,347.012,511.166,256z'/%3E%3Cpath style='fill:%233D9AE3;' d='M255.722,512c-87.455,0-168.01-44.081-215.484-117.917l-4.527-7.04l142.267-119.937l163.74,230.122 l-10.434,3.385C306.874,508.169,281.452,512,255.722,512z'/%3E%3Cpath style='fill:%231D81CE;' d='M342.752,496.827l-17.317-24.795c-30.569,19.333-65.625,32.915-103.137,37.801 c10.906,1.42,22.13,1.612,33.424,1.612C286.17,511.445,315.674,506.6,342.752,496.827z'/%3E%3Cpath style='fill:%23FFFFFF;' d='M177.978,267.106l44.425-33.319l170.805,238.278l-8.302,4.872 c-11.729,6.884-24.073,12.861-36.69,17.766l-6.499,2.527L177.978,267.106z'/%3E%3Cpath style='fill:%23E0E0E3;' d='M341.718,497.229c18.2-6.475,35.457-14.944,51.49-25.164l-24.615-34.338 c-13.395,13.232-28.248,24.992-44.293,35.023L341.718,497.229z'/%3E%3Cpath style='fill:%23FFCE00;' d='M31.37,379.188c-7.01-12.718-12.964-26.113-17.696-39.813l-2.112-8.059l299.691-208.592 l44.425,33.319L35.712,387.042L31.37,379.188z'/%3E%3Cpath style='fill:%23CD2900;' d='M382.579,250.216c-15.713-16.41-94.094-100.753-94.094-149.704C288.485,45.089,333.575,0,388.997,0 s100.512,45.089,100.512,100.512c0,48.918-78.382,133.287-94.095,149.704l0,0C391.917,253.87,386.077,253.871,382.579,250.216 L382.579,250.216z'/%3E%3Cpath style='fill:%23891D00;' d='M388.997,134.386c-24.803,0-44.98-20.178-44.98-44.98s20.178-44.98,44.98-44.98 c24.803,0,44.98,20.178,44.98,44.98S413.8,134.386,388.997,134.386z'/%3E%3Cpath style='fill:%23FFFFFF;' d='M144.659,186.586c29.088,0,52.755-23.666,52.755-52.755c0-4.6-3.729-8.33-8.33-8.33h-33.319 c-4.6,0-8.33,3.729-8.33,8.33c0,4.6,3.729,8.33,8.33,8.33h24.018c-3.769,15.901-18.088,27.766-35.125,27.766 c-19.902,0-36.095-16.193-36.095-36.095s16.193-36.095,36.095-36.095c8.8,0,17.275,3.202,23.865,9.015 c3.452,3.044,8.715,2.713,11.757-0.736c3.043-3.45,2.713-8.714-0.736-11.757c-9.636-8.5-22.025-13.181-34.886-13.181 c-29.088,0-52.755,23.666-52.755,52.755S115.57,186.586,144.659,186.586z'/%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A"); 83 | } 84 | 85 | .landviewer-logo { 86 | background-image: url("data:image/svg+xml,%3Csvg version='1.1' id='Слой_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 73.59 72.4' style='enable-background:new 0 0 73.59 72.4;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%2393D3EA;stroke:%231387C5;stroke-width:2;stroke-miterlimit:10;%7D .st1%7Bfill:%234F4F6B;%7D .st2%7Bfill:%23AFDDED;%7D .st3%7Bfill:none;stroke:%231387C5;stroke-width:2;stroke-miterlimit:10;%7D .st4%7Bfill:%23AFDDED;stroke:%231387C5;stroke-width:2;stroke-miterlimit:10;%7D .st5%7Bfill:none;stroke:%231589C6;stroke-width:2;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%231589C6;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;%7D .st7%7Bfill:%2393D3EA;%7D%0A%3C/style%3E%3Cpath class='st0' d='M72.59,49.44c0,12.13-9.83,21.96-21.96,21.96c-12.13,0-21.96-9.83-21.96-21.96c0-12.13,9.83-21.96,21.96-21.96 C62.75,27.47,72.59,37.31,72.59,49.44z'/%3E%3Cline class='st1' x1='9.74' y1='19.59' x2='20.1' y2='9.22'/%3E%3Cg%3E%3Cpath class='st2' d='M24.14,1.58c-0.78-0.78-2.05-0.78-2.83,0L18.2,4.69c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L24.14,1.58z'/%3E%3Cpath class='st3' d='M24.14,1.58c-0.78-0.78-2.05-0.78-2.83,0L18.2,4.69c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L24.14,1.58z'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st2' d='M7.52,17.02c-0.78-0.78-2.05-0.78-2.83,0l-3.11,3.11c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L7.52,17.02z'/%3E%3Cpath class='st3' d='M7.52,17.02c-0.78-0.78-2.05-0.78-2.83,0l-3.11,3.11c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L7.52,17.02z'/%3E%3C/g%3E%3Cpath class='st4' d='M14.16,8.55l9.09,9.09c-0.14,1.28-0.68,2.5-1.64,3.46c-0.96,0.96-2.18,1.5-3.46,1.64l-9.09-9.09 c0.14-1.28,0.68-2.5,1.64-3.46C11.66,9.23,12.88,8.69,14.16,8.55z'/%3E%3Cg%3E%3Cpath class='st5' d='M3.56,40.47c-0.16-1.26-0.25-2.54-0.25-3.84'/%3E%3Cpath class='st5' d='M4.86,46.24c-0.36-1.09-0.65-2.21-0.89-3.35'/%3E%3Cpath class='st5' d='M6.96,51.19c-0.5-0.94-0.94-1.9-1.35-2.89'/%3E%3Cpath class='st6' d='M27.2,67.08c-8.09-2.03-14.95-7.17-19.22-14.09'/%3E%3Cpath class='st5' d='M66.15,22.49c0.49,1.17,0.92,2.39,1.27,3.64'/%3E%3Cpath class='st5' d='M63.36,17.27c0.64,0.96,1.22,1.95,1.75,2.99'/%3E%3Cpath class='st5' d='M60.01,13.06c0.73,0.77,1.42,1.58,2.07,2.42'/%3E%3Cpath class='st6' d='M36.26,3.13c8.34-0.2,16.33,2.93,22.29,8.47'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st6' d='M55.97,32.22c0,0-0.53,0-1.19,0c-0.65,0-1.82,0.64-2.6,1.41l-0.73,0.73c-0.78,0.78-1.41,1.95-1.41,2.6 c0,0.65-0.8,1.19-1.78,1.19s-2.53,0.5-3.44,1.11l-0.23,0.16c-0.92,0.61-1.66,1.64-1.66,2.3c0,0.65,0.9,1.19,2,1.19h1.94 c1.1,0,2.27,0.27,2.59,0.59c0.33,0.33,1.13,0.59,1.78,0.59c0.65,0,1.72,0.53,2.37,1.19c0.65,0.65,2.09,1.19,3.19,1.19h0.75 c1.1,0,2.53,0.53,3.19,1.19c0.65,0.65,1.72,0.65,2.37,0c0.65-0.65,2.09-1.19,3.19-1.19h2.75'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st6' d='M56.19,52.63c-0.78-0.78-1.95-1.41-2.6-1.41c-0.65,0-1.82-0.64-2.6-1.41l-0.73-0.73 c-0.78-0.78-2.31-1.41-3.41-1.41h-0.75c-1.1,0-2.64,0.64-3.41,1.41l-0.73,0.73c-0.78,0.78-1.08,2.25-0.67,3.27l0.89,2.22 c0.41,1.02,1.54,1.86,2.52,1.86c0.98,0,2.32,0.53,2.97,1.19c0.65,0.65,1.19,2.09,1.19,3.19v1.94c0,1.1,0.27,2.27,0.59,2.59 c0.33,0.33,1.13,0.59,1.78,0.59c0.65,0,1.82-0.64,2.6-1.41l0.73-0.73c0.78-0.78,1.41-2.22,1.41-3.19s0.64-2.42,1.41-3.19l0.73-0.73 c0.78-0.78,0.78-2.05,0-2.83L56.19,52.63z'/%3E%3C/g%3E%3Cline class='st6' x1='9.74' y1='19.59' x2='20.1' y2='9.22'/%3E%3Cg%3E%3Cpath class='st6' d='M24.14,1.58c-0.78-0.78-2.05-0.78-2.83,0L18.2,4.69c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L24.14,1.58z'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st6' d='M7.52,17.02c-0.78-0.78-2.05-0.78-2.83,0l-3.11,3.11c-0.78,0.78-0.78,2.05,0,2.83l4.29,4.29 c0.78,0.78,2.05,0.78,2.83,0l3.11-3.11c0.78-0.78,0.78-2.05,0-2.83L7.52,17.02z'/%3E%3C/g%3E%3Cpath class='st6' d='M14.16,8.55l9.09,9.09c-0.14,1.28-0.68,2.5-1.64,3.46c-0.96,0.96-2.18,1.5-3.46,1.64l-9.09-9.09 c0.14-1.28,0.68-2.5,1.64-3.46C11.66,9.23,12.88,8.69,14.16,8.55z'/%3E%3Cline class='st6' x1='27.47' y1='26.29' x2='31.04' y2='29.85'/%3E%3Cg%3E%3Cpath class='st7' d='M20.91,32.44c-0.78,0.78-1.63,0.54-1.89-0.53c0,0-1.92-7.94,1.77-11.63c3.69-3.69,11.63-1.77,11.63-1.77 c1.07,0.26,1.31,1.11,0.53,1.89L20.91,32.44z'/%3E%3Cpath class='st3' d='M20.91,32.44c-0.78,0.78-1.63,0.54-1.89-0.53c0,0-1.92-7.94,1.77-11.63c3.69-3.69,11.63-1.77,11.63-1.77 c1.07,0.26,1.31,1.11,0.53,1.89L20.91,32.44z'/%3E%3C/g%3E%3C/svg%3E%0A"); 87 | } 88 | 89 | .openstreetmap-logo { 90 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADH0lEQVQ4y5XMS29UVQDA8f8598y9nfejLSAjZKxSHq1DKqSklSBhY2KMcYeJ30B3fgI3unIDGoxGNybUAGGhmC6MIUZTadI2fSA0tpTESh+Z6Wtm7sx9zjmuXLhw4e8D/MTCzu3RGHMDw3wU65uFdP+G0Vxs+s33Ng6evSylWT2UKV2XlvV9xipdxoirCZV46VTxShVAGGPEzM6tZTQnaUf0FEpoLai19/HCNtG+odx7ngQWkY7phBoltuntdcaGD78+LYUQRmvuGWPQfky7sY+JAyzdxa05nH7+EocLJfr6i+TyaVJJScNLsfa09j6ABETYNDXHSiELGWRXEGiP0O1wtDhAKplEWyCRpJ00pidGODFW4tjb/wQmn8tdsVUKRyZJ2hlqrT1W/nIpZMtYJgdRgdAr0Omk6QQaKyWItWdXq+OHpDEfShTjXRMSRj7tsElTt8lwlCDI0/IFQWjRCrrUGwZbFxECnLRSg9WB0+rB9oljUjdydsKh63pEmS5HrDJ/tFz8IMRJuQgV4HbyGBSO0wGSyERPZ/Xhw1k5/ty7z4Io3mx3WmgTImJFUvUzUBnlp8m7uF6X2HRIZbfJFjZJOopKpkLoysfGGCRAbWtnQVgSYSDwJToost9o8vv0L0zeuUccGwyGhGVRNDk263vsuo8+tbLZvAK6XtN7EsURLWOTi2x++PZrylkH6fikcjUeL61wvPwi0jI8qs8ijUcy7b0y7/u3FMDAC2dO2E6OtO1x58vvWPptnUXZ5I13rlId6UeVFJvrM+w39ohLkuOlAZamtteZm4slQLdHXDa4TFy7y8z9VeJ4lzMXTlEdPUKojtOjFYPlCoVKDuUYasGf5vpnX9wEjJrdu53fbbSTE59Msji9hq08Lr41xmsXhpEFpXOqLl23j2R2l8aBi5VQJKyEvzW/VQewhs+eLPmd9tnlX1cqBwc18eqbY+1sb2rx5/sL1z7/6JuPuybaSNgyE+tQ+q633dhuPfhxYuqD5dmnawACYGhoKHPpvP3V1KKoa2nfcET0ZG5uLuLfMoDLfxCD5871jYyM9PM//Q1n7HZWySeChQAAAABJRU5ErkJggg=='); 91 | } 92 | 93 | .mapbox-logo { 94 | background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='new' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 187.5 180' style='enable-background:new 0 0 180 180;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%234264FB;%7D%0A%3C/style%3E%3Ctitle%3EMapbox_Logo_08%3C/title%3E%3Cg%3E%3Cg%3E%3Cpath class='st0' d='M93.9,1.1C44.8,1.1,5,40.9,5,90s39.8,88.9,88.9,88.9s88.9-39.8,88.9-88.9C182.8,40.9,143,1.1,93.9,1.1z M136.1,111.8c-30.4,30.4-84.7,20.7-84.7,20.7s-9.8-54.2,20.7-84.7C89,30.9,117,31.6,134.7,49.2S153,94.9,136.1,111.8L136.1,111.8 z'/%3E%3Cpolygon class='st0' points='104.1,53.2 95.4,71.1 77.5,79.8 95.4,88.5 104.1,106.4 112.8,88.5 130.7,79.8 112.8,71.1 '/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); 95 | } 96 | 97 | .mapillary-logo { 98 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAvVBMVEUAAAAFy2MGzGQGymMFzGIFymIFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MFy2MDy2IMzGcp03kGy2MCymE01YC/8tck0XYAyl9z4qfp+vGB5bAOzWg61oR446u68dRc3Zmo7cki0XUp0nlh3p1H2Yxx4aYIzGUd0HJy4qdU25Q81oW079A+14YZz3Bj35618NHd+Oqm7McKzGYEy2Ir03uM57fX9+ZL2o8DymH///9yTDgMAAAAE3RSTlMAAAAAAAAHSajk+xiS77EG7afjlPTRTgAAAAFiS0dEPklkAOMAAAAJcEhZcwAALEsAACxLAaU9lqkAAAAHdElNRQfjBRYBCyQ/oxOSAAAArElEQVQY012P6RKCMAyEUw8KbTlbBTxQRLzvE6/3fy1pcJzR/EnzTbq7AQBiUNNizDKpQQCgRriwJZYtOKkD4Y4eFCKHE3CFfrXaIRLhAvXKHsWdLu54FHw99/rJoNLxIZBymI6ycT7BlQCYVNMsmYXzxVIDVgIpV+t8s93tIwSB9lSH4+l8ueIXH7UKebs/npEWRVtMFqeFtq2C6XopDPaJLr/RG7/HNeH//DcShRNe0McWHAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNS0yMlQwMToxMTozNiswMjowMA2IsjgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDUtMjJUMDE6MTE6MzYrMDI6MDB81QqEAAAAV3pUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAHic4/IMCHFWKCjKT8vMSeVSAAMjCy5jCxMjE0uTFAMTIESANMNkAyOzVCDL2NTIxMzEHMQHy4BIoEouAOoXEXTyQjWVAAAAAElFTkSuQmCC'); 99 | } 100 | 101 | .openstreetcam-logo { 102 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABsFBMVEUAAAAOAAAIAAAVAAAPAAEVAAAbHB8bHB8bHB8UFBoVExgZHSIbJi0cJi0YHSMUEhgZFhcbHB8bHB8ZGh4jJSQ4VFNMW0kdIygbGx0bHB8bHB8bHB8bGx0cJiwhVGsfU2wbHB8aFhcaFhcbISYnLi0oLiwaICYWAAAFAAYCAAcPAAA4e40vjK4nibNXhnwbHB8aGx4sLymAlGat0pOt2Z2Pz61XvMyo15+Vy6EqeJccKjIbGx4bHB4aIShRhoO125e93JG825C825G22ZSy2JZavMgqreUleJwcIicbGhwgTWEtqtx1xbm725G/3I+o1Zw5sNoqrOMrqd4gTGEbHiElep4prudKttGv15iq1Zt3xbdlv8Exrt4rrOIrr+UbHSEcJCoojrorruUsrOJhvsSa0KNVusopq+Mojrkoj7orruRZu8iNzKtrwb4vreAbHiImfKGKy6y625KHyq4hUGUrqt8qrOJ+x7O+3JCWz6Yxrt8qqt8hUGYcJCkmfaNLttCt1pmSzqkwsOIbGx0dLTYrquAqruZpwsG63JSk1qFLtc0lfaNyqJKVtH9GiJH///97pjWBAAAAK3RSTlMAAAAAAAIJDw4SQ4SlpYRDErLLy9Dy8tDLv9fW1tv39xYaT5Ozs5MBBgYBL/ZuuAAAAAFiS0dEj/UCg/kAAAAHdElNRQfhDAYNKBsutyRPAAABAElEQVQY02NgAAFGJlZWJkYwk4GNnZ2Dk4ubh5ePX4CDnZ2NQVBISFhEVFtHV09MXEJISJBBX9/A0MjYxNTM3MLSylpfn0HfxtbO3sHRydnF1c3dwwYo4Onl7ePk6+TnHxAYFOwJFAgJDQuPcIyMio6JjQuN12ewTkhMSk5JTUtPj41NykiwBgpkZsXGZufk5qXHZmUCBfTzC5JiY5MLi4rDY5MK8kGGlpTGxpaVV/hVVlXXgAy1rq1Lig2sb/BrbKqrtQYK6De31LW2tXd0dnW3NAMdJiklLSMrV9fT2ycvKyMtJcnAoaCgoKikrKKqpqQIZHJAvMysrqGpxQJmAgCiFz5y6dOefAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0xMi0wNlQxMzo0MDoyNyswMTowMPLAlXAAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMTItMDZUMTM6NDA6MjcrMDE6MDCDnS3MAAAAV3pUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAHic4/IMCHFWKCjKT8vMSeVSAAMjCy5jCxMjE0uTFAMTIESANMNkAyOzVCDL2NTIxMzEHMQHy4BIoEouAOoXEXTyQjWVAAAAAElFTkSuQmCC'); 103 | } 104 | 105 | .sentinelhub-logo { 106 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAS1BMVEUwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBWWSRDRCppbR6+yATI0gGrtAo6Oi2PlRN8gRmiqQ2YnxC1vgeFixZgYyFzdxtNTidTV8mGAAAACHRSTlMGhOSH6oqN52bhDgYAAAB0SURBVBjTXY9REoMwCERXjUpitpomtt7/pFXSEZUPWN4MsABNK2e0DdDJLTq4KrwPWh20TJHkS6WCOXJJ72zAs5xLFAQy3YCsZJmuQD6FXK9A5EsGu3Ik0tuVmFNmtJHt8FW2CtzfeW1364/nemAYrR0H/AC/mQkegjhjMAAAAABJRU5ErkJggg=='); 107 | } 108 | 109 | .snapchat-logo { 110 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAEG0lEQVQ4EQEQBO/7AP/8AC///ADc//wA///8AP///AD///wA///8AP///AD///wA///8AP///AD///wA///8AP///AD///wA3P/8AC8B//wA3AAAACMAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAAAAAP4AAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAA3QH//AD/AAAAAAAAAAAAAAAAAAEAAPr6AADR0QAA1dYVAP//AQAsKuoALi8AAAcHAAAA/wAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAD39gAAYmMRAP4AxQBFRtIARkfRAAADyABkZRQA9vUAAAAAAAAAAAAAAAAAAAAAAAAA//wA///8AP///AD///8A/52cC//d3eH///////f39//39/f//////+Dg4/+Zlgz///8A///8AP///AD///wA/wD//AD///wA///8AP///wD/T048///////p6en/NDQ0/zIyMv/n5+f//////01MQv///wD///wA///8AP///AD/BAAAAAAAAAAAAAAAAAAAAAAGBigAAAAAANvb2wDMzMwAAAAAANfX1wAYGBgADxEpAAD9vgAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAPr61gAAAAAALS0tAEpKSgD9/f0AMjIyAAAAAADw8NMAAAMAAAD9AAAAAAAAAAAAAAD//AD///wA///8AP///wD/lZMU/+Tk5///////////////////////5ubp/5COFv///wD///wA///8AP///AD/AgAAAAAAAAAAAAAAAAD9AABGRuwAvLynAAAAAAAAAAAAAAAAAAAAAAC/v6wASUjqAAD9AAAAAAAAAAAAAAAAAAAA//wA///8AP///AD///wA////AP9WVAD/7+/w////////////8/L0/1NTAP///wD///wA///8AP///AD///wA/wD//AD///wA///8AP///AD///0A//v4AP9RUUL//v7+//////9RUUb/+PUA///9AP///AD///wA///8AP///AD/Af/8AP8AAAAAAAAAAAAAAAAAAAAAAAIAAMC/AAD197MAAwMEAAQCSgBERf8AAP4AAAAAAAAAAAAAAAAAAAAAAAAB//wA/wAAAAAAAAAAAAAAAAAAAAAAAAAA/v4AAKiqCwD//gEAWVj0AAICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//ADcAAAAIwAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAA/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdAgAAAFMAAADdAAAAAAAAAAAAAAAAAAAAAAAAAAAA/QAAAP0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3QAAAFPKSnxhjJKa4gAAAABJRU5ErkJggg=='); 111 | } 112 | 113 | .twitter-logo { 114 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAEG0lEQVQ4EQEQBO/7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2h8g4dofIUAAAAAAAAAAAAAAAAAAAAAAEAAAAAHaHyEAAAAADjXw7wAAAAAAAAAAAAAAAAAAAAAAAAAAAdofJiAAAAQwAAAAYAAADJAAAAxAAAAAgAAADRAQAAAAAdofJXAAAASAAAAHXjXw7sAAAAAAAAAAAAAAAAHaHyWgAAAJ0AAAAIAAAAAAAAAPsAAADYAAAA1wAAAIQCAAAAAAAAABcAAABgAAAAph2h8kEAAAAAAAAAAAAAAAAAAAB0AAAACAAAAAAAAAAAAAAABQAAAC0AAADzAAAA6gQAAAAAAAAA1gAAAOoAAABFAAAALx2h8s4AAAC4AAAAzQAAAB0AAAAAAAAAAAAAAAAAAAAAAAAA7AAAALPjXw7pBAAAAAAAAAD4AAAA3gAAABYAAAAWAAAARwAAAD8AAAD6AAAADQAAAAAAAAAAAAAAAAAAAAAAAADxAAAA7AAAAAAEAAAAAAAAABkAAAA1AAAAAAAAAAAAAAABAAAACQAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOUAAADrAAAAAAIAAAAAAAAAugAAAKEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0gAAAN0AAAAAAgAAAADjXw7xAAAAkQAAAMMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAAC8418O/QAAAAACAAAAAAAAAAAAAAD7AAAA9QAAAPcAAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArwAAALQAAAAAAAAAAAIAAAAAAAAAAONfDtcAAABjAAAApAAAAPcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALMAAACI418O/QAAAAAAAAAABB2h8gMAAAAhAAAALgAAABwAAAAcAAAABwAAAAAAAAAAAAAAAAAAAPEAAACuAAAAhONfDuIAAAAAAAAAAAAAAAAEAAAAAAAAAAoAAAAyAAAASAAAABwAAADvAAAA+AAAAOcAAADUAAAAvQAAAK/jXw73HaHyAeNfDv8AAAAAAAAAAAEAAAAAAAAAAB2h8ggAAAAgAAAAFgAAAAgAAAD6AAAA7QAAAN7jXw71AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0cV+02KefbgAAAABJRU5ErkJggg==') 115 | } 116 | 117 | .wikimapia-logo { 118 | background-image: url("data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8ArKn4YFtV8b8kHO3/JBzt/yQc7f8kHO3/W1Xxv6yp+GD///8A////AP///wD///8A////AP///wDj4vwfTUbwzyQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/TUbwz+Pi/B////8A////AP///wDj4vwfMSru7iQc7f8xKu7ukIz1gePi/B////8A////AOPi/B+QjPWBMSru7iQc7f8xKu7u4+L8H////wD///8ATUbwzyQc7f9NRvDP4+L8H////wDV1PswkIz1gZCM9YHV1Psw////AOPi/B9NRvDPJBzt/01G8M////8ArKn4YCQc7f8xKu7u4+L8H/Hw/Q9bVfG/JBzt/yQc7f8kHO3/JBzt/1tV8b/x8P0P4+L8HzEq7u4kHO3/rKn4YFtV8b8kHO3/kIz1gf///wBbVfG/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/W1Xxv////wCQjPWBJBzt/1tV8b8kHO3/JBzt/+Pi/B/V1PswJBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f/V1Psw4+L8HyQc7f8kHO3/JBzt/yQc7f////8AkIz1gSQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/kIz1gf///wAkHO3/JBzt/yQc7f8kHO3/////AJCM9YEkHO3/JBzt/yQc7f8kHO3/////AP///wD///8A////AP///wD///8A////AP///wAkHO3/JBzt/+Pi/B/V1PswJBzt/yQc7f8kHO3/JBzt/////wD///8A////AP///wD///8A////AP///wD///8AW1XxvyQc7f+QjPWB////AFtV8b8kHO3/JBzt/yQc7f////8A////AP///wD///8A////AP///wD///8A////AKyp+GAkHO3/MSru7uPi/B/x8P0PW1XxvyQc7f8kHO3/////AP///wD///8A////AP///wD///8A////AP///wD///8ATUbwzyQc7f9NRvDP4+L8H////wDV1PswkIz1gf///wD///8A////AP///wD///8A////AP///wD///8A////AOPi/B8xKu7uJBzt/zEq7u6QjPWB4+L8H////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A4+L8H01G8M8kHO3/JBzt/yQc7f8kHO3/////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8ArKn4YFtV8b8kHO3/JBzt/////wD///8A////AP///wD///8A////AP///wD///8A+B8AAOAHAADDwwAAjnEAAJgZAAAQCAAAMAwAACAEAAAg/wAAMP8AABD/AACY/wAAjv8AAMP/AADg/wAA+P8AAA=="); 119 | } 120 | 121 | .yandexmaps-logo { 122 | background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='katman_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 106.7 100' style='enable-background:new 0 0 106.7 100;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23E00000;%7D .st1%7Bfill:%23FF3333;%7D .st2%7Bfill:%23FFFFFF;%7D%0A%3C/style%3E%3Cg transform='translate(10.85 1)'%3E%3Cpath class='st0' d='M54.7,40l18.2-8.3c0,14.5-10,29.5-18.9,43.8L38.7,98.2l6.7-41.4L54.7,40L54.7,40z'/%3E%3Ccircle class='st1' cx='42.2' cy='30.7' r='30.8'/%3E%3Ccircle class='st2' cx='42.2' cy='30.7' r='12.3'/%3E%3C/g%3E%3C/svg%3E%0A"); 123 | } 124 | 125 | .zillow-logo { 126 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAEG0lEQVQ4EQEQBO/7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAavydAGr8nAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAXtUZAAkhswADCTMAAAAAAP33zQD3300AoivnAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAFjSPgATLbIA/wAPAAAAAAAAAAAAAAAAAAEA8ADt008AqC7CAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAABl7XQABRKLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD77nQAmxONAAAAAAAAAAABAAAAAABSuAcAFD2jAAQKVQAAAAAAAAAAAAAAAAAAAAAAAQDxAPnusQADCcgAAgeRAAECBQD99qkA5sZeALNF+gEAVc4WABUxwgAAACcAAAAAAAAAAAABAPoA/fe9AAMFlACVBbkAAAD9AAAAAABl71YABRCpAAAAAAAAANcA688+BAAIEzUAAAAnAAAAAAABAOgA+vCXAPfjnACkLuYAAAAAAAAAAAAAAAAAAAAAAP7+QAAAAAAAAAAAAAAAKQAJFDIEAAICAAD//+sA/vh2ALZPpQDju/sAAAAAAFTKIgAMHQAAoBneAECNBQArcbQA/wFGAAAAAAAAAAAAAQAAAAEC/gQA78zHAKFDGgAA2vwAAAABAF7jQgAMGnwA+u7HAJwVewA+lAQAKmq+AP8BPAACAPoA+vXYAAMCsgDv4b8A8NfFAAAAAAAAAAAGAGfyYQBr/9gAav//AGDhhwAAAAAAPp8GAG3/rgBi6LsAa/lYADN+FwAAAAAAAAAAAAAAAAAAAAABAFPKKgAZNb0A/gAYAAAAAAAB/qQAlQNdAAAAAABd2RQA6tUEALlS6AAAAAAAAAAAAAAAAAAAAAAAN4cpACdb6QQAChcfAP4AGAAAAAAA//3OAJYEXQAAAAAAAAAAAKMn7AAAAAAAAAAAAC5lCQAxgUoABghPAAMKSAAFBxUA8eRFBAAAAAAAAAAAAAAAAADx3WoAAAAAAAAAAAAAAAAARrELAB49TwADDF4AAwRGAAEBAQD/AAAAAAAAAP0AAAAA//8EAAAAAAAAAAAAAAAAABAlqAAtcCsAKVcnABIxdAACB1EAAAAJAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAEgAD6P3gAAABcA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAA/wAAAAAA/wAWAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAC0C6bScbJ33wAAAABJRU5ErkJggg=='); 127 | } 128 | 129 | .zoomearth-logo { 130 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACzklEQVR4AWL4//8/TiwtrSQnLqkog08NhoCcmiWAb2qAkWuBovnht23bVm23a9u2MbZtdzyztvF2a9u2EVSnNsIb3ePfS2gu69qNB3YbmlYtrlD1tY2sObZfZCP63v1q7N9PfBAQVV4gcy0eIpYtwZ41BMLzubB6G+FyudDT0oLVu84eZ0r9jkc++H9BVkquoNHj9HrR39eLyTFURFSKsLWzCX9F1OD7nwKRRZHg/OmdJ/Mrxdz7Hnz04acfih2dTdMy+SjnmUASG1HNNkNVlofz/SYM1FnBvXZnJifAzisDgItff/vnr3cezE2sLZufKcEfUQy4nG4kV0jAzQ4FumpxcP0QtphSsEuVhCXKZIwuW4+thA8TMnXSOw/yGWZtVCEPC9LpSC7lISyPjqSkKMhIqbCyCtEiLYCLlw11RTx0Ug5i08iYTBkS3HlA9DT1icRqTE1iYHJcLYIz6Fi1cStMDheoQgGMdhPy84tQReLAoeAiKq4SM6nEyJ0HJXR1UgGJDaFCi3KWGnylCRZfHQRaK6Yn0LBp8yqcOXsKxNJBLLz27Mv5DASwCfHzr7371I0HEYVcfXB6GRJzKvFNIAn/RpARkMHArEQKEgvo4KmsAK5gTmwyfPU+mJwtaB7duv4Og8kBqcXRBVTE5JIxI4WJuelszE5lXpNDxi8hVZgUkAqPkYlJc+IwPqoMQosfuUyH+c6DV1566w2a1N6XUCpAVAEPH86swsw0LlKqJPhqARnPjEkFvSgFMVmV+C2chFL35tUfffPnz/cV6e/x88LS2f6RbJIcco0Jar0VNocXg/2tMDoaEJRGQj7TCIF//fKQLA71kVX+fXxgtNDSs9ngbQNfbQdFbIZA44DN1wR7Qw+MHZtW1zJlwieO6bkXXn8tIZem8DT1biWWrj1fq+5sstUP9oi17qtbqqhuoIM3M2FIMnGwcnHzceFTAwBbOpZLUKkZuAAAAABJRU5ErkJggg=='); 131 | } 132 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/markercluster.css: -------------------------------------------------------------------------------- 1 | /* Custom MarkerCluster style */ 2 | .marker-cluster-blue { 3 | background-color: rgba(29, 161, 242, 0.6); 4 | margin-left: -20px; 5 | margin-top: -20px; 6 | width: 40px; 7 | height: 40px; 8 | } 9 | 10 | .marker-cluster-blue div { 11 | background-color: rgba(29, 161, 242, 0.6); 12 | } 13 | 14 | .marker-cluster-blue div span { 15 | font-weight: bold; 16 | color: white; 17 | } 18 | 19 | /* IE 6-8 fallback colors */ 20 | .leaflet-oldie .marker-cluster-blue { 21 | background-color: rgb(29, 161, 242); 22 | } 23 | 24 | .leaflet-oldie .marker-cluster-blue div { 25 | background-color: rgb(29, 161, 242); 26 | } 27 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/misc.css: -------------------------------------------------------------------------------- 1 | /* 2 | Fix gap between tiles 3 | https://github.com/Leaflet/Leaflet/issues/3339 4 | */ 5 | .leaflet-tile-container img { 6 | will-change: unset !important; 7 | } 8 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/popup.css: -------------------------------------------------------------------------------- 1 | /* Tabs */ 2 | .leaflet-popup-content { 3 | width: 470px; 4 | margin: 7px 9px !important; 5 | min-height: 205px; 6 | } 7 | 8 | .tabs { 9 | position: relative; 10 | min-height: 200px; 11 | clear: both; 12 | margin-top: 20px; 13 | font: normal normal 14px/1.4 Helvetica, Roboto, "Segoe UI", Calibri, sans-serif; 14 | color: #1c2022; 15 | } 16 | 17 | .tab { 18 | visibility: hidden; 19 | } 20 | 21 | .tab:first-of-type { 22 | visibility: visible; 23 | } 24 | 25 | .tabs-link { 26 | position: relative; 27 | top: -14px; 28 | height: 20px; 29 | left: -40px; 30 | } 31 | 32 | .tab-link { 33 | display: inline-block; 34 | padding: 6px 14px; 35 | position: relative; 36 | list-style-type: none; 37 | left: 0; 38 | top: 0; 39 | cursor: pointer; 40 | } 41 | 42 | .tabs-link a li { 43 | border-right: 1px solid #e1e8ed; 44 | } 45 | 46 | .tabs-link a:last-of-type li { 47 | border-right: none; 48 | } 49 | 50 | .tabs-link a:hover { 51 | text-decoration: none; 52 | color: #1DA1F2; 53 | } 54 | 55 | .content { 56 | background: white; 57 | /* position:absolute; */ 58 | top: 28px; 59 | left: 0; 60 | right: 0; 61 | bottom: 0; 62 | } 63 | 64 | .content-location { 65 | position: absolute; 66 | } 67 | 68 | .tab:target { 69 | visibility: visible; 70 | } 71 | 72 | /* Override Leaflet defaults */ 73 | .leaflet-popup-content-wrapper { 74 | padding: 8px !important; 75 | } 76 | 77 | .leaflet-container a.leaflet-popup-close-button { 78 | padding: 0 !important; 79 | font: 18px/20px Tahoma, Verdana, sans-serif !important; 80 | margin: 6px; 81 | } 82 | 83 | .leaflet-popup-content p { 84 | margin: 0 !important; 85 | } 86 | -------------------------------------------------------------------------------- /tweetsmapper/resources/css/tweet-tab.css: -------------------------------------------------------------------------------- 1 | .tweet-container { 2 | position: relative; 3 | display: block; 4 | width: 100%; 5 | border: 1px solid #e1e8ed; 6 | border-radius: 5px; 7 | overflow: hidden; 8 | } 9 | 10 | .tweet { 11 | padding: 20px 20px 11.6px 20px; 12 | width: 470px; 13 | } 14 | 15 | .tweet-flex { 16 | display: -webkit-box; 17 | display: -webkit-flex; 18 | display: -moz-box; 19 | display: -ms-flexbox; 20 | display: flex; 21 | } 22 | 23 | .tweet-header>a { 24 | -webkit-flex-basis: 36px; 25 | -ms-flex-preferred-size: 36px; 26 | flex-basis: 36px; 27 | -webkit-box-flex: 0; 28 | -webkit-flex: none; 29 | -moz-box-flex: 0; 30 | -ms-flex: none; 31 | flex: none; 32 | height: 36px; 33 | background-color: transparent; 34 | margin-right: 9px; 35 | } 36 | 37 | .tweet-header>a>img { 38 | max-width: 100%; 39 | max-height: 100%; 40 | border-radius: 50%; 41 | border: 0; 42 | } 43 | 44 | .tweet-author { 45 | -webkit-box-orient: vertical; 46 | -webkit-box-direction: normal; 47 | -webkit-flex-direction: column; 48 | -moz-box-orient: vertical; 49 | -moz-box-direction: normal; 50 | -ms-flex-direction: column; 51 | flex-direction: column; 52 | overflow: hidden; 53 | line-height: 1.2; 54 | } 55 | 56 | .tweet-author-decorated-name { 57 | -webkit-box-align: center; 58 | -webkit-align-items: center; 59 | -moz-box-align: center; 60 | -ms-flex-align: center; 61 | align-items: center; 62 | min-width: 0; 63 | } 64 | 65 | .tweet-author-name { 66 | overflow: hidden; 67 | text-overflow: ellipsis; 68 | white-space: nowrap; 69 | padding-right: 4px; 70 | font-weight: 700; 71 | } 72 | 73 | .tweet-author-verified { 74 | position: static; 75 | -webkit-box-flex: 0; 76 | -webkit-flex: none; 77 | -moz-box-flex: 0; 78 | -ms-flex: none; 79 | flex: none; 80 | padding-right: 4px; 81 | } 82 | 83 | .tweet-icon-verified { 84 | width: 1.11111em; 85 | background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2072%22%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%200h64v72H0z%22%2F%3E%3Cpath%20fill%3D%22%231da1f2%22%20d%3D%22M3%2037.315c0%204.125%202.162%207.726%205.363%209.624-.056.467-.09.937-.09%201.42%200%206.103%204.72%2011.045%2010.546%2011.045%201.295%200%202.542-.234%203.687-.686C24.22%2062.4%2027.827%2064.93%2032%2064.93c4.174%200%207.782-2.53%209.49-6.213%201.148.45%202.39.685%203.69.685%205.826%200%2010.546-4.94%2010.546-11.045%200-.483-.037-.953-.093-1.42C58.83%2045.04%2061%2041.44%2061%2037.314c0-4.37-2.42-8.15-5.933-9.946.427-1.203.658-2.5.658-3.865%200-6.104-4.72-11.045-10.545-11.045-1.302%200-2.543.232-3.69.688-1.707-3.685-5.315-6.216-9.49-6.216-4.173%200-7.778%202.53-9.492%206.216-1.146-.455-2.393-.688-3.688-.688-5.827%200-10.545%204.94-10.545%2011.045%200%201.364.23%202.662.656%203.864C5.42%2029.163%203%2032.944%203%2037.314z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M17.87%2039.08l7.015%206.978c.585.582%201.35.873%202.116.873.77%200%201.542-.294%202.127-.883.344-.346%2015.98-15.974%2015.98-15.974%201.172-1.172%201.172-3.07%200-4.243-1.17-1.17-3.07-1.172-4.242%200l-13.87%2013.863-4.892-4.868c-1.174-1.168-3.074-1.164-4.242.01-1.168%201.176-1.163%203.075.01%204.244z%22%2F%3E%3C%2Fsvg%3E); 86 | } 87 | 88 | .tweet-author-screenname { 89 | font-size: 14px; 90 | overflow: hidden; 91 | text-overflow: ellipsis; 92 | white-space: nowrap; 93 | -webkit-flex-shrink: 1; 94 | -ms-flex-negative: 1; 95 | flex-shrink: 1; 96 | color: #697882; 97 | } 98 | 99 | .tweet-brand { 100 | margin-left: auto; 101 | } 102 | 103 | .tweet-brand a { 104 | color: #2b7bb9; 105 | text-decoration: none; 106 | background-color: transparent; 107 | } 108 | 109 | .tweet-icon-bird { 110 | width: 1.25em; 111 | background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2072%2072%22%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%200h72v72H0z%22%2F%3E%3Cpath%20class%3D%22icon%22%20fill%3D%22%231da1f2%22%20d%3D%22M68.812%2015.14c-2.348%201.04-4.87%201.744-7.52%202.06%202.704-1.62%204.78-4.186%205.757-7.243-2.53%201.5-5.33%202.592-8.314%203.176C56.35%2010.59%2052.948%209%2049.182%209c-7.23%200-13.092%205.86-13.092%2013.093%200%201.026.118%202.02.338%202.98C25.543%2024.527%2015.9%2019.318%209.44%2011.396c-1.125%201.936-1.77%204.184-1.77%206.58%200%204.543%202.312%208.552%205.824%2010.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163%200%206.345%204.513%2011.638%2010.504%2012.84-1.1.298-2.256.457-3.45.457-.845%200-1.666-.078-2.464-.23%201.667%205.2%206.5%208.985%2012.23%209.09-4.482%203.51-10.13%205.605-16.26%205.605-1.055%200-2.096-.06-3.122-.184%205.794%203.717%2012.676%205.882%2020.067%205.882%2024.083%200%2037.25-19.95%2037.25-37.25%200-.565-.013-1.133-.038-1.693%202.558-1.847%204.778-4.15%206.532-6.774z%22%2F%3E%3C%2Fsvg%3E); 112 | } 113 | 114 | .tweet-body { 115 | margin-top: 14px; 116 | } 117 | 118 | .tweet-text { 119 | white-space: pre-wrap; 120 | cursor: text; 121 | word-wrap: break-word; 122 | margin: 13px 0 !important; 123 | } 124 | 125 | .tweet-info, 126 | .tweet-coordinates { 127 | margin-top: 6px; 128 | font-size: 12.5px; 129 | color: #697882; 130 | } 131 | 132 | .tweet-icon-heart { 133 | width: 1.25em; 134 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath class='icon' fill='%23697882' d='M12 21.638h-.014C9.403 21.59 1.95 14.856 1.95 8.478c0-3.064 2.525-5.754 5.403-5.754 2.29 0 3.83 1.58 4.646 2.73.813-1.148 2.353-2.73 4.644-2.73 2.88 0 5.404 2.69 5.404 5.755 0 6.375-7.454 13.11-10.037 13.156H12zM7.354 4.225c-2.08 0-3.903 1.988-3.903 4.255 0 5.74 7.035 11.596 8.55 11.658 1.52-.062 8.55-5.917 8.55-11.658 0-2.267-1.822-4.255-3.902-4.255-2.528 0-3.94 2.936-3.952 2.965-.23.562-1.156.562-1.387 0-.015-.03-1.426-2.965-3.955-2.965z'/%3E%3C/svg%3E"); 135 | } 136 | 137 | .tweet-icon-location { 138 | color: #697882; 139 | width: 1.25em; 140 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewbox='0 0 24 24' fill='%23697882' %3E%3Cpath opacity='0' d='M0 0h24v24H0z' /%3E%3Cpath d='M12 2.03c-4.792 0-8.692 3.9-8.692 8.692 0 1.9.603 3.707 1.752 5.234 1.628 2.07 6.278 5.757 6.475 5.912.136.108.3.162.465.162s.33-.054.465-.162c.197-.155 4.847-3.84 6.484-5.925 1.14-1.515 1.74-3.32 1.74-5.222 0-4.79-3.9-8.69-8.69-8.69zm0 12c-1.933 0-3.5-1.568-3.5-3.5s1.567-3.5 3.5-3.5 3.5 1.566 3.5 3.5-1.567 3.5-3.5 3.5z' /%3E%3C/svg%3E"); 141 | } 142 | 143 | .tweet-icon { 144 | display: inline-block; 145 | height: 1.25em; 146 | background-repeat: no-repeat; 147 | background-size: contain; 148 | vertical-align: text-bottom; 149 | } 150 | 151 | .tweet-info-heart-stat { 152 | margin-left: 3px; 153 | } 154 | 155 | .tweet-info-timegeo { 156 | margin-left: 12px; 157 | color: #697882; 158 | -webkit-box-flex: 1; 159 | -webkit-flex: 1; 160 | -moz-box-flex: 1; 161 | -ms-flex: 1; 162 | flex: 1; 163 | } 164 | 165 | .tweet-icon-notice { 166 | height: 18px; 167 | width: 18px; 168 | background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2072%2072%22%3E%3Cg%20transform%3D%22translate(8%208)%22%3E%3Cpath%20fill%3D%22%23657786%22%20fill-opacity%3D%22.8%22%20d%3D%22M28%203.11C14.278%203.11%203.11%2014.276%203.11%2028c0%2013.723%2011.166%2024.887%2024.89%2024.887S52.89%2041.723%2052.89%2028C52.89%2014.274%2041.724%203.11%2028%203.11z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M28%2044.593c-1.718%200-3.11-1.393-3.11-3.112V30.076c0-1.718%201.392-3.11%203.11-3.11s3.11%201.392%203.11%203.11V41.48c0%201.72-1.392%203.113-3.11%203.113z%22%2F%3E%3Ccircle%20fill%3D%22%23FFF%22%20cx%3D%2228%22%20cy%3D%2218.148%22%20r%3D%224.667%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M28%2056C12.56%2056%200%2043.44%200%2028S12.56%200%2028%200s28%2012.56%2028%2028-12.56%2028-28%2028zm0-49.778C15.99%206.222%206.222%2015.992%206.222%2028S15.992%2049.778%2028%2049.778c12.01%200%2021.778-9.77%2021.778-21.778S40.008%206.222%2028%206.222z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E'); 169 | } 170 | 171 | .tweet-text a, 172 | .tweet-text a:link, 173 | .tweet-text a:visited { 174 | color: #2B7BB9 !important; 175 | } 176 | 177 | .tweet-text a:hover { 178 | color: #1DA1F2 !important; 179 | } 180 | 181 | .tweet a, 182 | .tweet a:link, 183 | .tweet a:visited { 184 | text-decoration: none; 185 | color: inherit; 186 | } 187 | 188 | .tweet a:hover { 189 | color: #1DA1F2; 190 | } 191 | 192 | .tweet-media { 193 | position: relative; 194 | width: 100%; 195 | max-height: 400px; 196 | overflow: hidden; 197 | border-bottom: 1px solid #e1e8ed; 198 | } 199 | 200 | .tweet-media>a { 201 | display: block; 202 | top: 0; 203 | left: 0; 204 | width: 100%; 205 | height: 100%; 206 | line-height: 0; 207 | -webkit-transition: opacity .5s; 208 | -o-transition: opacity .5s; 209 | -moz-transition: opacity .5s; 210 | transition: opacity .5s; 211 | color: white !important; 212 | } 213 | 214 | .tweet-media img { 215 | border: 0; 216 | line-height: 0; 217 | width: 100% 218 | } 219 | 220 | .tweet-media-overlay { 221 | position: absolute; 222 | top: 43%; 223 | left: 43%; 224 | } 225 | 226 | .tweet-icon-play { 227 | width: 80px; 228 | height: 80px; 229 | background-image: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2060%2072%22%3E%3Cpath%20opacity%3D%22.8%22%20fill%3D%22%231DA1F2%22%20d%3D%22M30%2012C16.768%2012%206%2022.765%206%2036s10.766%2023.998%2024%2023.998%2024-10.765%2024-24S43.235%2012%2030%2012z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M39.2%2034.34l-12-9c-.606-.455-1.418-.528-2.094-.19-.677.34-1.106%201.032-1.106%201.79v18c0%20.758.428%201.45%201.106%201.79.283.14.59.21.894.21.425%200%20.847-.136%201.2-.4l12-9c.503-.377.8-.97.8-1.6%200-.63-.295-1.223-.8-1.6z%22%2F%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M30%2015c11.598%200%2021%209.402%2021%2021s-9.4%2020.998-21%2020.998-21-9.402-21-21S18.4%2015%2030%2015m0-6C15.112%209%203%2021.11%203%2036s12.112%2026.998%2027%2026.998%2027-12.11%2027-27S44.888%209%2030%209z%22%2F%3E%3C%2Fsvg%3E); 230 | } 231 | 232 | .tweet-coordinates>span { 233 | margin-left: 8px; 234 | } 235 | 236 | img.emoji { 237 | cursor: default; 238 | height: 1em; 239 | width: 1em; 240 | margin: 0 .05em 0 .1em; 241 | vertical-align: -0.1em; 242 | } 243 | 244 | .multiple-media-overlay { 245 | position: absolute; 246 | top: 0; 247 | right: 10px; 248 | height: 25px; 249 | padding: 0 5px; 250 | line-height: 24px; 251 | font-size: 12px; 252 | font-weight: bold; 253 | border-bottom-left-radius: 5px; 254 | border-bottom-right-radius: 5px; 255 | background-color: rgba(21, 24, 40, 0.75); 256 | } 257 | -------------------------------------------------------------------------------- /tweetsmapper/resources/img/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r3mlab/tweetsmapper/7f1fb850b46523ab8d02843b1071d087e07f693b/tweetsmapper/resources/img/marker.png -------------------------------------------------------------------------------- /tweetsmapper/resources/js/create_cluster_icon.js: -------------------------------------------------------------------------------- 1 | function(cluster) { 2 | return new L.divIcon({ 3 | html: '
' + cluster.getChildCount() + '
', 4 | className: 'marker-cluster marker-cluster-blue', 5 | iconSize: new L.Point(40, 40) 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /tweetsmapper/resources/templates/coordinates-tab.html.j2: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Longitude:{{ tweet.coordinates['coordinates'][0] }}
Latitude:{{ tweet.coordinates['coordinates'][1] }}
15 |
16 | 17 | 48 | 49 |
50 | -------------------------------------------------------------------------------- /tweetsmapper/resources/templates/legend.html.j2: -------------------------------------------------------------------------------- 1 |
2 | 3 | {% if emoji == 'user' %} 4 |

5 | 6 | 👤 {{ title }} 7 | 8 |

9 | 10 | {% elif emoji == 'file' %} 11 |

📄 {{ title }}

12 | 13 | {% else %} 14 |

{{ title }}

15 | 16 | {% endif %} 17 |
18 | 19 |
20 |

Generated {{ gen_datetime }} UTC

21 |

tweetsmapper v{{ version }}

22 |
23 | -------------------------------------------------------------------------------- /tweetsmapper/resources/templates/place-tab.html.j2: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {% if tweet.place.type %} 14 | 15 | 16 | 17 | 18 | {% endif %} 19 | 20 | 21 | 22 | 23 |
Place ID:{{ tweet.place.id }}
Full name:{{ tweet.place.full_name }}
Type:{{ tweet.place.type }}
Country:{{ tweet.place.country }}
24 |
25 | 51 | 52 |
53 | -------------------------------------------------------------------------------- /tweetsmapper/resources/templates/popup.html.j2: -------------------------------------------------------------------------------- 1 |
2 | 17 |
18 |
19 | {% include 'tweet.html.j2' %} 20 |
21 |
22 | 23 | {% if tweet.place %} 24 |
25 |
26 | {% include 'place-tab.html.j2' %} 27 |
28 |
29 | {% endif %} 30 | 31 | {% if tweet.coordinates %} 32 |
33 |
34 | {% include 'coordinates-tab.html.j2' %} 35 |
36 |
37 | {% endif %} 38 | 39 |
40 | -------------------------------------------------------------------------------- /tweetsmapper/resources/templates/tweet.html.j2: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | {% if tweet.entities.media %} 5 | 20 | {% endif %} 21 | 22 |
23 | 24 | 47 | 48 |
49 |

{{ tweet_html_text }}

50 |
51 | 57 |
58 | 59 | 60 | 61 | {% if tweet.place %} 62 | · 63 | {{ tweet.place.full_name }} 64 | {% endif %} 65 |
66 |
67 | 68 |
69 | 70 |
71 | {% if tweet.coordinates %} 72 |
73 |
74 | Lon: {{ tweet.coordinates['coordinates'][0] }} 75 | Lat: {{ tweet.coordinates['coordinates'][1] }} 76 |
77 | {% endif %} 78 |
79 |
80 |
81 |
82 | -------------------------------------------------------------------------------- /tweetsmapper/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | import logging 22 | import pkg_resources 23 | import os 24 | import sys 25 | import datetime 26 | import argparse 27 | 28 | from .utils import args_check, api, import_file, map, results, scrape 29 | 30 | 31 | # logging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s') 32 | logging.basicConfig(level=logging.INFO, format="%(message)s") 33 | log = logging.getLogger("tweetsmapper") 34 | 35 | 36 | def get_tweets(args): 37 | """Get tweets to consider for mapping.""" 38 | geo_tweets = [] 39 | 40 | input_source = args_check.input_source(args) 41 | 42 | if input_source == "user": 43 | log.debug("Input source = user") 44 | # Auth 45 | keys = api.get_keys(args.config_path) 46 | twitter_api = api.authenticate(keys) 47 | 48 | # Check that user exists 49 | api.get_user_info(twitter_api, args.screen_name) 50 | 51 | # Download 52 | if args.limit and args.limit <= 3200: 53 | geo_tweets = api.download_tweets( 54 | twitter_api, args.screen_name, limit=args.limit 55 | ) 56 | else: 57 | ids = scrape.get_ids(args.screen_name, args.limit) 58 | tweets = api.hydrate(ids, twitter_api) 59 | geo_tweets = [t for t in tweets if results.is_geo(t)] 60 | 61 | elif input_source == "file": 62 | log.debug("Input source = file") 63 | if args.limit != 3200: 64 | log.info( 65 | "Note: Limit argument (-l) has no effect when mapping from a file." 66 | ) 67 | geo_tweets = import_file.process_tweets(args.input_file, args.config_path) 68 | 69 | results.check(geo_tweets) 70 | 71 | return geo_tweets 72 | 73 | 74 | def tweetsmapper(args): 75 | """Main logic.""" 76 | if args.configure: 77 | api.configure(args.config_path) 78 | else: 79 | 80 | geo_tweets = get_tweets(args) 81 | 82 | # Initialize Leaflet map 83 | tweets_map = map.create() 84 | # Initialize Leaflet MarkerCluster & FeatureGroupSubGroups 85 | tweets_cluster = map.add_cluster(tweets_map) 86 | 87 | map.add_tweets( 88 | geo_tweets=geo_tweets, cluster=tweets_cluster, tweets_map=tweets_map 89 | ) 90 | # Customize map 91 | tweets_map = map.customize(tweets_map, args, geo_tweets) 92 | 93 | # Save map 94 | map.save(tweets_map, args) 95 | 96 | 97 | def main(): 98 | banner = "tweetsmapper v{} - (C) r3mlab - GPLv3 License - https://github.com/r3mlab/tweetsmapper".format( 99 | pkg_resources.get_distribution("tweetsmapper").version 100 | ) 101 | log.info(banner) 102 | # Parse arguments 103 | script_description = "Generate Leaflet maps from geo-enabled tweets." 104 | # usage = "\n\ntweetsmapper -n [options]" 105 | parser = argparse.ArgumentParser(description=script_description) 106 | # parser = argparse.ArgumentParser(description=script_description, usage=usage) 107 | 108 | exclusive = parser.add_mutually_exclusive_group() 109 | 110 | exclusive.add_argument( 111 | "-n", 112 | "--screen-name", 113 | type=args_check.screen_name, 114 | # required=True, 115 | help="Screen name of the user to target (uses the API)", 116 | metavar="SCREEN_NAME", 117 | ) 118 | 119 | exclusive.add_argument( 120 | "-i", 121 | "--input-file", 122 | type=args_check.input_file, 123 | help="Path to a collection of tweets. Supports: JSONL, TXT", 124 | metavar="INPUT_FILE", 125 | ) 126 | 127 | parser.add_argument( 128 | "-l", 129 | "--limit", 130 | type=int, 131 | help="Limit the number of tweets to retrieve (default = no limit)", 132 | metavar="N", 133 | ) 134 | 135 | parser.add_argument( 136 | "-o", 137 | "--output-path", 138 | type=args_check.output_path, 139 | help="Map output file", 140 | metavar="OUTPUT_FILE", 141 | ) 142 | 143 | parser.add_argument( 144 | "-t", 145 | "--custom-title", 146 | type=str, 147 | help="Custom HTML title for map legend", 148 | metavar="CUSTOM_TITLE", 149 | ) 150 | 151 | exclusive.add_argument( 152 | "--configure", action="store_true", help="Configure Twitter API credentials" 153 | ) 154 | 155 | parser.add_argument( 156 | "-c", 157 | "--config-path", 158 | type=args_check.config_file, 159 | help="Path to configuration file", 160 | metavar="CONFIG_FILE", 161 | ) 162 | 163 | args = parser.parse_args() 164 | 165 | tweetsmapper(args) 166 | -------------------------------------------------------------------------------- /tweetsmapper/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | from os import path 22 | 23 | utils_path = path.abspath(path.dirname(__file__)) 24 | resources_path = path.join(utils_path, "..", "resources") 25 | -------------------------------------------------------------------------------- /tweetsmapper/utils/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | API Actions 23 | """ 24 | 25 | import logging 26 | import os 27 | import configparser 28 | import tweepy 29 | from tqdm import tqdm 30 | 31 | from tweetsmapper.utils import results 32 | 33 | logging.basicConfig(level=logging.INFO, format="%(message)s") 34 | log = logging.getLogger("tweetsmapper-api") 35 | 36 | 37 | def check_keys_env(): 38 | """Check if API credentials are defined through environment variables.""" 39 | env_vars = [ 40 | "CONSUMER_KEY", 41 | "CONSUMER_SECRET", 42 | "ACCESS_TOKEN", 43 | "ACCESS_TOKEN_SECRET", 44 | ] 45 | 46 | if all(variable in os.environ for variable in env_vars): 47 | log.debug("All credentials environment variables are defined") 48 | return True 49 | else: 50 | return False 51 | log.debug("Environmental variables missing or incomplete") 52 | 53 | 54 | def authenticate(keys): 55 | """Configure the Twitter API.""" 56 | auth = tweepy.OAuthHandler(keys["consumer_key"], keys["consumer_secret"]) 57 | auth.set_access_token(keys["access_token"], keys["access_token_secret"]) 58 | twitter_api = tweepy.API( 59 | auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True 60 | ) 61 | return twitter_api 62 | 63 | 64 | def register_config(config_path): 65 | """Save the API credentials to a file.""" 66 | log.debug("Registering API credentials") 67 | 68 | print("Please enter your Twitter API credentials.") 69 | consumer_key = input("Consumer key: ") 70 | consumer_secret = input("Consumer secret: ") 71 | access_token = input("Access Token: ") 72 | access_token_secret = input("Access Token Secret: ") 73 | 74 | twitter_api = authenticate( 75 | consumer_key, consumer_secret, access_token, access_token_secret 76 | ) 77 | 78 | try: 79 | log.debug("Verifying credentials...") 80 | twitter_api.verify_credentials() 81 | log.info("Congratulations! Your credentials are valid.") 82 | 83 | profile = twitter_api.me().screen_name 84 | log.debug(f"API User: {profile}") 85 | 86 | config = configparser.ConfigParser() 87 | config.add_section(profile) 88 | config.set(profile, "consumer_key", consumer_key) 89 | config.set(profile, "consumer_secret", consumer_secret) 90 | config.set(profile, "access_token", access_token) 91 | config.set(profile, "access_token_secret", access_token_secret) 92 | 93 | # config_path = os.path.join(os.path.expanduser("~"), ".tweetsmapper") 94 | log.debug(f"Config will be written to {config_path}") 95 | with open(config_path, "w") as config_file: 96 | log.debug("Writing file...") 97 | config.write(config_file) 98 | log.info( 99 | f"\nTwitter API credentials for user {profile} have been stored in {config_path}" 100 | ) 101 | log.info( 102 | "Your are free to move this file around and specify its path with -c" 103 | ) 104 | 105 | except tweepy.error.TweepError as e: 106 | log.error( 107 | "Your API credentials are invalid.", 108 | "Please double check them and run the configuration utility again.", 109 | "(tweetsmapper --configure)", 110 | ) 111 | log.debug(f"Error: {e}") 112 | 113 | 114 | def validate_keys(twitter_api): 115 | """Verify the API credentials are correct.""" 116 | log.debug("Checking credentials validity...") 117 | try: 118 | twitter_api.verify_credentials() 119 | log.debug("Credentials are valid.") 120 | return True 121 | except tweepy.error.TweepError as e: 122 | return False 123 | log.debug(f"Error: {e}") 124 | 125 | 126 | def get_keys(config_path): 127 | """Get the api credentials from env variables or from a file. 128 | 129 | Priority is given to env variables, unless a custom config path is given.""" 130 | log.debug("Getting API keys...") 131 | keys = {} 132 | if check_keys_env() and config_path is None: 133 | log.debug("Trying to get API keys from env vars") 134 | env = os.environ.get 135 | keys["consumer_key"] = env("CONSUMER_KEY") 136 | keys["consumer_secret"] = env("CONSUMER_SECRET") 137 | keys["access_token"] = env("ACCESS_TOKEN") 138 | keys["access_token_secret"] = env("ACCESS_TOKEN_SECRET") 139 | log.debug(f"Keys: {keys}") 140 | else: 141 | log.debug("Trying to get API keys from config file") 142 | config = configparser.ConfigParser() 143 | 144 | if config_path == None: 145 | log.debug(f"No custom config file specified") 146 | log.debug("Setting config file path to default") 147 | config_path = os.path.join(os.path.expanduser("~"), ".tweetsmapper") 148 | 149 | log.debug(f"Reading config file {config_path}...") 150 | config.read(config_path) 151 | profile = config.sections()[0] 152 | 153 | keys["consumer_key"] = config.get(profile, "consumer_key") 154 | keys["consumer_secret"] = config.get(profile, "consumer_secret") 155 | keys["access_token"] = config.get(profile, "access_token") 156 | keys["access_token_secret"] = config.get(profile, "access_token_secret") 157 | log.debug(f"Keys: {keys}") 158 | 159 | return keys 160 | 161 | 162 | def configure(config_path): 163 | """Configure API credentials.""" 164 | try: 165 | register = "yes" 166 | 167 | # Check existing credentials 168 | if config_path == None: 169 | config_path = os.path.join(os.path.expanduser("~"), ".tweetsmapper") 170 | 171 | if check_keys_env() or os.path.exists(config_path): 172 | if check_keys_env(): 173 | log.info("Environment variables detected") 174 | elif os.path.exists(config_path): 175 | log.info(f"Configuration file detected: {config_path}") 176 | 177 | keys = get_keys(config_path) 178 | 179 | log.info(f"Consumer Key: {keys['consumer_key']}") 180 | log.info(f"Consumer Secret: {keys['consumer_secret']}") 181 | log.info(f"Access Token: {keys['access_token']}") 182 | log.info(f"Access Token Secret: {keys['access_token_secret']}") 183 | 184 | twitter_api = authenticate(keys) 185 | 186 | if validate_keys(twitter_api): 187 | if check_keys_env(): 188 | log.info( 189 | "Valid configuration for user {} found in environment variables.".format( 190 | twitter_api.me().screen_name, config_path 191 | ) 192 | ) 193 | register = "no" 194 | elif os.path.exists(config_path): 195 | log.info( 196 | "Valid configuration for user {} found at {}".format( 197 | twitter_api.me().screen_name, config_path 198 | ) 199 | ) 200 | replace = input( 201 | "Would you like to replace this configuration? (y/n): " 202 | ) 203 | if replace.lower() not in ["y", "yes"]: 204 | register = "no" 205 | else: 206 | log.debug("Checking if we get keys from env...") 207 | if check_keys_env(): 208 | log.info("Logging error...") 209 | log.error( 210 | "Your API credentials are invalid." 211 | "\n" 212 | "Please check your environment variables and try again." 213 | ) 214 | register = "no" 215 | elif os.path.exists(config_path): 216 | log.error( 217 | f"Your API credentials are invalid. Reconfiguring...\n" 218 | ) 219 | 220 | if register == "yes": 221 | register_config(config_path) 222 | except KeyboardInterrupt: 223 | log.critical("\n\rExiting Twitter API configuration utility...") 224 | 225 | 226 | def get_user_info(twitter_api, screen_name): 227 | """Fetch info about a user from the API.""" 228 | try: 229 | log.debug(f"Trying to fetch info for user {screen_name}") 230 | user_info = twitter_api.get_user(screen_name=screen_name) 231 | log.debug(f"Fetched user info.") 232 | return user_info 233 | except tweepy.error.TweepError as error: 234 | try: 235 | message = error.args[0][0]["message"] 236 | log.error(f"Twitter error: {message}") 237 | if message in ["Could not authenticate you.", "Bad Authentication data."]: 238 | log.info( 239 | "Please check your API credentials " 240 | "or run tweetsmapper --configure to register them." 241 | ) 242 | except TypeError: 243 | log.error(f"Twitter error: {error}") 244 | 245 | raise SystemExit(1) 246 | 247 | 248 | def download_tweets(twitter_api, screen_name, limit): 249 | """Download tweets from the API and filter those containing geo information.""" 250 | 251 | log.info(f"Trying to download last {limit} tweets for user {screen_name}...") 252 | 253 | log.debug("Checking if user exists...") 254 | 255 | log.debug("Starting to download tweets...") 256 | tweets_list = tweepy.Cursor( 257 | twitter_api.user_timeline, screen_name=screen_name, tweet_mode="extended" 258 | ).items(limit) 259 | 260 | geo_tweets = [] 261 | try: 262 | count = 0 263 | for tweet in tqdm(tweets_list, unit=" tweets", total=limit): 264 | count += 1 265 | if results.is_geo(tweet): 266 | geo_tweets.append(tweet) 267 | if count != limit: 268 | log.info(f"Could only fetch {count} tweets.") 269 | except tweepy.error.TweepError as error: 270 | log.error(f"Twitter error: {error}") 271 | raise SystemExit(1) 272 | 273 | return geo_tweets 274 | 275 | 276 | def chunks(list, chunk_size): 277 | """Yield successive chunks from a list.""" 278 | for i in range(0, len(list), chunk_size): 279 | yield list[i : i + chunk_size] 280 | 281 | 282 | def hydrate(ids_list, twitter_api): 283 | log.info("Hydrating tweets...") 284 | try: 285 | pbar = tqdm(unit=" tweets", total=len(ids_list)) 286 | all_statuses = [] 287 | for chunk in chunks(ids_list, 100): 288 | statuses = twitter_api.statuses_lookup(chunk, tweet_mode="extended") 289 | all_statuses.extend(statuses) 290 | pbar.update(len(chunk)) 291 | pbar.close() 292 | return all_statuses 293 | except tweepy.error.TweepError as error: 294 | log.error(f"Twitter error: {error}") 295 | raise SystemExit(1) 296 | -------------------------------------------------------------------------------- /tweetsmapper/utils/args_check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Argument checks 23 | """ 24 | 25 | import logging 26 | import os 27 | import argparse 28 | 29 | 30 | logging.basicConfig(level=logging.INFO, format="%(message)s") 31 | log = logging.getLogger("tweetsmapper-argscheck") 32 | 33 | 34 | def screen_name(screen_name): 35 | """Remove @ in screen name if needed.""" 36 | if screen_name.startswith("@"): 37 | log.debug("Removing @ in target screen_name") 38 | screen_name.replace("@", "") 39 | return screen_name 40 | 41 | 42 | def input_file(path): 43 | """Checks if the input file has valid path and filetype.""" 44 | 45 | if os.path.exists(path) is False: 46 | raise argparse.ArgumentTypeError(f"Could not find file {path}") 47 | log.debug("Found input file: {path}") 48 | suffix = os.path.splitext(path)[1].lower()[1:] 49 | supported_filetypes = ["jsonl", "txt"] 50 | 51 | if suffix in supported_filetypes: 52 | return path 53 | else: 54 | raise argparse.ArgumentTypeError( 55 | "Cannot process file {}. Supported extensions: {}".format( 56 | path, " ".join(supported_filetypes) 57 | ) 58 | ) 59 | 60 | 61 | def output_path(path): 62 | """Validate output path.""" 63 | if os.path.dirname(path) == "" or os.path.isdir(os.path.dirname(path)): 64 | log.debug(f"Output path {path} is correct.") 65 | return path 66 | else: 67 | raise argparse.ArgumentTypeError(f"{path} is not a valid output path.") 68 | 69 | 70 | def input_source(args): 71 | """Check if we should map tweets for a username or from a file.""" 72 | if args.screen_name: 73 | return "user" 74 | elif args.input_file: 75 | return "file" 76 | else: 77 | log.critical( 78 | "Please specify a username (-n user) or a collection of tweets (-i tweets.jsonl) to start," 79 | "\n" 80 | "or see the help: tweetsmapper -h" 81 | ) 82 | raise SystemExit(1) 83 | 84 | 85 | def config_file(path): 86 | """Check if configuration file exists.""" 87 | if not os.path.exists(path): 88 | raise argparse.ArgumentTypeError(f"{path} is not a valid path.") 89 | log.debug(f"Found configuration file: {path}") 90 | -------------------------------------------------------------------------------- /tweetsmapper/utils/display.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Display, formatting, etc. 23 | """ 24 | 25 | import logging 26 | import datetime 27 | import os 28 | import jinja2 29 | import emoji 30 | from ttp import ttp 31 | 32 | from tweetsmapper.utils import services, resources_path 33 | import pkg_resources 34 | 35 | logging.basicConfig(level=logging.INFO, format="%(message)s") 36 | log = logging.getLogger("tweetsmapper-display") 37 | 38 | 39 | def format_like(num): 40 | """Format an integer into Twitter like string.""" 41 | if num > 999999: 42 | like_num = str(round(num, -6))[: len(str(num)) - 6] + "M" 43 | elif num > 999: 44 | like_num = str(round(num, -3))[: len(str(num)) - 3] + "K" 45 | else: 46 | like_num = num 47 | 48 | return like_num 49 | 50 | 51 | def format_tweet_emojis(tweet_text): 52 | """Detect emojis in tweet and replace them with a Twemoji html code. 53 | 54 | This is needed to display the most recent unicode emojis, 55 | many of which are unsupported by web browsers.""" 56 | emoji_template = '{char}' 57 | 58 | for e in emoji.UNICODE_EMOJI.keys(): 59 | if e in tweet_text: 60 | esc_char = e.encode("unicode-escape").lower() 61 | esc_char_codes = esc_char.split(b"\\u") 62 | 63 | fileroot_codes = [ 64 | x.decode("utf-8").replace("000", "") for x in esc_char_codes if x != b"" 65 | ] 66 | fileroot = "-".join(fileroot_codes) 67 | 68 | emoji_html = emoji_template.format(char=e, fileroot=fileroot) 69 | tweet_text = tweet_text.replace(e, emoji_html) 70 | 71 | return tweet_text 72 | 73 | 74 | def format_tweet_text(tweet_text): 75 | """Convert tweet text to html: add mentions, hashtags, emoji, links.""" 76 | # Emoji support 77 | tweet_processed_text = format_tweet_emojis(tweet_text) 78 | # Mentions, hashtags, links 79 | tweet_processed_text = ttp.Parser().parse(tweet_processed_text).html 80 | # Links customization 81 | tweet_processed_text = tweet_processed_text.replace( 82 | " tag.""" 128 | title = "{} - tweetsmapper v{}".format( 129 | string, pkg_resources.get_distribution("tweetsmapper").version 130 | ) 131 | return title 132 | -------------------------------------------------------------------------------- /tweetsmapper/utils/import_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | File Imports 23 | """ 24 | 25 | import logging 26 | import os 27 | import json 28 | import tweepy 29 | 30 | from tweetsmapper.utils import results, api 31 | 32 | logging.basicConfig(level=logging.INFO, format="%(message)s") 33 | log = logging.getLogger("tweetsmapper-fileinput") 34 | 35 | 36 | def process_tweets(input_file, config_file=None): 37 | """Check file extension and process the file accordingly.""" 38 | 39 | suffix = os.path.splitext(input_file)[1].lower()[1:] 40 | 41 | if suffix == "jsonl": 42 | log.info(f"Reading tweets from {input_file}...") 43 | log.debug("Processing JSONL file.") 44 | geo_tweets = read_jsonl(input_file) 45 | 46 | elif suffix == "txt": 47 | log.info(f"Reading tweet IDs from {input_file}...") 48 | keys = api.get_keys(config_file) 49 | twitter_api = api.authenticate(keys) 50 | geo_tweets = read_txt(input_file, twitter_api) 51 | return geo_tweets 52 | 53 | 54 | def read_jsonl(input_file): 55 | """Read tweets from a .jsonl file.""" 56 | geo_tweets = [] 57 | with open(input_file) as input: 58 | for line in input.readlines(): 59 | tweet_json = json.loads(line) 60 | tweet = tweepy.models.Status().parse(tweepy.api, tweet_json) 61 | if results.is_geo(tweet): 62 | geo_tweets.append(tweet) 63 | return geo_tweets 64 | 65 | 66 | def read_txt(input_file, twitter_api): 67 | """Read tweets ids from a .txt file and rehydrate them with the API.""" 68 | ids_list = [] 69 | with open(input_file) as input: 70 | for line in input.readlines(): 71 | line = line.strip() 72 | if line.isdigit(): 73 | id = line 74 | else: 75 | id = line.split(" ")[0] 76 | ids_list.append(id) 77 | 78 | tweets = api.hydrate(ids_list, twitter_api) 79 | 80 | geo_tweets = [t for t in tweets if results.is_geo(t)] 81 | # for t in tweets: 82 | # if results.is_geo(t): 83 | # geo_tweets.append(t) 84 | 85 | return geo_tweets 86 | 87 | 88 | def has_unique_author(geo_tweets): 89 | "Check if all geo tweets are from the same user." 90 | userid_list = [] 91 | for num, tweet in enumerate(geo_tweets): 92 | if tweet.user.id not in userid_list: 93 | userid_list.append(tweet.user.id) 94 | 95 | return True if len(userid_list) == 1 else False 96 | -------------------------------------------------------------------------------- /tweetsmapper/utils/map.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Map Actions 23 | """ 24 | 25 | import logging 26 | import datetime 27 | import os 28 | import folium 29 | from folium.plugins import MarkerCluster, FeatureGroupSubGroup 30 | import jinja2 31 | 32 | from tweetsmapper.utils import args_check, display, import_file, resources_path 33 | 34 | logging.basicConfig(level=logging.INFO, format="%(message)s") 35 | log = logging.getLogger("tweetsmapper-map") 36 | 37 | 38 | def create(): 39 | """Create the base Leaftlet map.""" 40 | log.debug("Creating the Leaflet map...") 41 | tweets_map = folium.Map( 42 | # Start location 43 | [30, 0], 44 | tiles=None, # Add tiles later so they don't show up on LayerControl 45 | max_bounds=True, 46 | zoom_start=2, 47 | ) 48 | log.debug("Adding CartoDB tiles layer...") 49 | folium.raster_layers.TileLayer( 50 | tiles="Cartodb positron", 51 | attr=( 52 | 'Tiles: OpenStreetMap, ' 53 | 'CartoDB' 54 | ), 55 | control=False, 56 | min_zoom=2, 57 | ).add_to(tweets_map) 58 | 59 | return tweets_map 60 | 61 | 62 | def add_cluster(tweets_map): 63 | """Create a Leaflet MarkerCluster to hold all geo tweets.""" 64 | with open(os.path.join(resources_path, "js", "create_cluster_icon.js")) as js_file: 65 | create_cluster_icon = js_file.read() 66 | 67 | log.debug("Creating MarkerCluster...") 68 | tweets_cluster = MarkerCluster( 69 | control=False, 70 | icon_create_function=create_cluster_icon, 71 | options={ 72 | "showCoverageOnHover": False, 73 | "spiderfyDistanceMultiplier": 1.7, 74 | "spiderLegPolylineOptions": { 75 | "weight": 2, 76 | "color": "#1DA1F2", 77 | "opacity": 0.5, 78 | }, 79 | }, 80 | ) 81 | tweets_map.add_child(tweets_cluster) 82 | 83 | return tweets_cluster 84 | 85 | 86 | def find_centroid(coordinates): 87 | """Return the centroid of a bounding box.""" 88 | lon_list = [point[0] for point in coordinates[0]] 89 | lat_list = [point[1] for point in coordinates[0]] 90 | centroid = ( 91 | sum(lat_list) / float(len(lat_list)), 92 | sum(lon_list) / float(len(lon_list)), 93 | ) 94 | return centroid 95 | 96 | 97 | def add_marker(tweet, subgroup, popup_template): 98 | """Create a marker representing a tweet.""" 99 | # Get coordinates 100 | if tweet.coordinates: 101 | lat, lon = ( 102 | tweet.coordinates["coordinates"][1], 103 | tweet.coordinates["coordinates"][0], 104 | ) 105 | else: 106 | lat, lon = find_centroid(tweet.place.bounding_box.coordinates) 107 | 108 | # Custom Icon 109 | twitter_icon = folium.features.CustomIcon( 110 | os.path.join(resources_path, "img", "marker.png"), 111 | icon_size=(36, 45), 112 | icon_anchor=(18, 45), 113 | popup_anchor=(0, -38), 114 | ) 115 | # Add marker 116 | folium.Marker( 117 | location=[lat, lon], 118 | icon=twitter_icon, 119 | popup=folium.Popup( 120 | display.tweet_to_html(tweet, popup_template), parse_html=False 121 | ), 122 | ).add_to(subgroup) 123 | 124 | log.debug( 125 | "Added tweet {} to map. Place: {}, lat:{}, lon:{}".format( 126 | tweet.id_str, 127 | tweet.place.full_name if tweet.place else "None", 128 | tweet.coordinates["coordinates"][1] if tweet.coordinates else None, 129 | tweet.coordinates["coordinates"][0] if tweet.coordinates else None, 130 | ) 131 | ) 132 | 133 | 134 | def add_tweets(geo_tweets, cluster, tweets_map): 135 | """Add all geo enabled tweets on the map.""" 136 | 137 | # Define subgroups for LayerControl 138 | coords_count = sum(1 for t in geo_tweets if t.coordinates) 139 | place_count = len(geo_tweets) - coords_count 140 | coords_subgroup = FeatureGroupSubGroup( 141 | cluster, f"Tweets with coordinates ({coords_count})" 142 | ) 143 | place_subgroup = FeatureGroupSubGroup( 144 | cluster, f"Tweets with place only ({place_count})" 145 | ) 146 | 147 | # Load popup html template 148 | 149 | popup_template = display.get_template("popup.html.j2") 150 | 151 | # Map tweets 152 | for tweet in geo_tweets: 153 | subgroup = coords_subgroup if tweet.coordinates else place_subgroup 154 | 155 | add_marker(tweet=tweet, subgroup=subgroup, popup_template=popup_template) 156 | 157 | # Add subgroups to map 158 | for subgroup in [coords_subgroup, place_subgroup]: 159 | tweets_map.add_child(subgroup) 160 | 161 | 162 | def add_info(tweets_map, args, geo_tweets): 163 | """Add contextual info to the map: legend title, timestamp, etc.""" 164 | 165 | if args.custom_title: 166 | title = args.custom_title 167 | emoji = None 168 | elif args_check.input_source(args) == "api" or import_file.has_unique_author( 169 | geo_tweets 170 | ): 171 | title = "@" + geo_tweets[0].user.screen_name 172 | emoji = "user" 173 | else: 174 | title = os.path.basename(args.input_file) 175 | emoji = "file" 176 | 177 | legend_html = display.create_legend(title, emoji) 178 | tweets_map.get_root().html.add_child(folium.Element(legend_html)) 179 | 180 | # HTML 181 | tweets_map.get_root().header.add_child( 182 | folium.Element("<title>{}".format(display.create_title(title))) 183 | ) 184 | 185 | return tweets_map 186 | 187 | 188 | def customize(tweets_map, args, geo_tweets): 189 | """Customize the Leaflet map: LayerControl, legend, additional CSS.""" 190 | 191 | log.debug("Adding LayerControl...") 192 | # Adding LayerControl 193 | folium.LayerControl(position="bottomleft", collapsed=False).add_to(tweets_map) 194 | 195 | log.debug("Adding legend info...") 196 | # Adding legend info to map 197 | tweets_map = add_info(tweets_map, args, geo_tweets) 198 | 199 | # Additional CSS 200 | log.debug("Including additional CSS...") 201 | css_dir = os.path.join(resources_path, "css") 202 | for css_file_path in [x for x in os.listdir(css_dir)]: 203 | with open(os.path.join(css_dir, css_file_path)) as css_file: 204 | css = css_file.read() 205 | tweets_map.get_root().header.add_child( 206 | folium.Element(f"") 207 | ) 208 | 209 | return tweets_map 210 | 211 | 212 | def save(tweets_map, args): 213 | """Save the Leaflet map as an HTML file.""" 214 | 215 | # Define base filename 216 | if args_check.input_source(args) == "user": 217 | title = args.screen_name 218 | elif args_check.input_source(args) == "file": 219 | title = os.path.splitext(os.path.basename(args.input_file))[0] 220 | 221 | default_filename = "{}-{}.html".format( 222 | title, datetime.datetime.utcnow().strftime("%Y%m%d-%H%M") 223 | ) 224 | 225 | # Saving file 226 | if args.output_path: 227 | if os.path.isdir(args.output_path): 228 | output_path = os.path.join(args.output_path, default_filename) 229 | else: 230 | output_path = args.output_path 231 | else: 232 | output_path = default_filename 233 | 234 | abs_output_path = os.path.abspath(output_path) 235 | log.debug(f"Trying to save map to {abs_output_path}...") 236 | tweets_map.save(output_path) 237 | log.info(f"Map saved to {abs_output_path}") 238 | -------------------------------------------------------------------------------- /tweetsmapper/utils/results.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Results check 23 | """ 24 | 25 | import logging 26 | 27 | logging.basicConfig(level=logging.INFO, format="%(message)s") 28 | log = logging.getLogger("tweetsmapper-results") 29 | 30 | 31 | def is_geo(tweet): 32 | """Filter geo-enabled tweets.""" 33 | if tweet.place: 34 | return True 35 | elif tweet.coordinates: 36 | lat, lon = ( 37 | tweet.coordinates["coordinates"][1], 38 | tweet.coordinates["coordinates"][0], 39 | ) 40 | if lat == 0 and lon == 0: 41 | log.debug( 42 | "Tweet ID {} has lat: 0 & lon: 0. Filtering it out.".format( 43 | tweet.id_str 44 | ) 45 | ) 46 | return False 47 | else: 48 | return True 49 | 50 | else: 51 | return False 52 | 53 | 54 | def check(geo_tweets): 55 | """Check results and display how many geo enabled tweets were found.""" 56 | if len(geo_tweets) == 0: 57 | log.error("Could not find tweets with geo information for this user.") 58 | raise SystemExit(1) 59 | else: 60 | tweets_w_coordinates_count = sum(1 for t in geo_tweets if t.coordinates) 61 | log.info( 62 | "Found {} geo enabled tweets, including {} with coordinates.".format( 63 | len(geo_tweets), tweets_w_coordinates_count 64 | ) 65 | ) 66 | -------------------------------------------------------------------------------- /tweetsmapper/utils/scrape.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Scraping with twint 23 | """ 24 | 25 | import logging 26 | import twint 27 | 28 | logging.basicConfig(level=logging.INFO, format="%(message)s") 29 | log = logging.getLogger("tweetsmapper-scrape") 30 | 31 | 32 | def get_ids(screen_name, limit): 33 | """Scrape tweet IDs for a given user.""" 34 | c = twint.Config() 35 | c.Username = screen_name 36 | if limit: 37 | c.Limit = limit 38 | c.Store_object = True 39 | # c.Hide_output = True 40 | c.Format = "\033[A\33[2K\rID: {id} | DATE: {date}\r" 41 | 42 | limit_str = limit if limit != None else "all" 43 | log.info( 44 | f"Trying to collect {limit_str} tweet IDs for user {screen_name}. (May take a while)\n" 45 | ) 46 | twint.run.Search(c) 47 | tweets = twint.output.tweets_object 48 | ids = [t.id for t in tweets] 49 | 50 | log.info("\033[A\33[2K\rDone! Collected {} tweet IDs.".format(len(ids))) 51 | 52 | return ids 53 | -------------------------------------------------------------------------------- /tweetsmapper/utils/services.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # tweetsmapper 5 | # Copyright (C) 2019 r3mlab 6 | # https://github.com/r3mlab/tweetsmapper 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | """ 22 | Search services 23 | """ 24 | 25 | from_coordinates = [ 26 | { 27 | "name": "Bing Maps", 28 | "countries": ["all"], 29 | "link": "https://www.bing.com/maps?&cp={lat}~{lon}&lvl=20&sty=a&w=100%", 30 | "logo_css_class": "bing-logo", 31 | }, 32 | { 33 | "name": "Descartes Labs", 34 | "countries": ["all"], 35 | "link": "https://search.descarteslabs.com/?layer=landsat-8_v3_rgb_2013-2017#lat={lat}&lng={lon}&skipTut=true&zoom=17", 36 | "logo_css_class": "descartes-logo", 37 | }, 38 | { 39 | "name": "Here", 40 | "countries": ["all"], 41 | "link": "https://wego.here.com/?map={lat},{lon},18,satellite&x=ep", 42 | "logo_css_class": "here-logo", 43 | }, 44 | { 45 | "name": "Google Maps", 46 | "countries": ["all"], 47 | "link": "https://maps.google.com/?t=k&q={lat}, {lon}", 48 | "logo_css_class": "googlemaps-logo", 49 | }, 50 | { 51 | "name": "EOS Landviewer", 52 | "countries": ["all"], 53 | "link": "https://eos.com/landviewer/?lat={lat}&lng={lon}&z=16", 54 | "logo_css_class": "landviewer-logo", 55 | }, 56 | { 57 | "name": "Mapbox", 58 | "countries": ["all"], 59 | "link": "https://labs.mapbox.com/bites/00145/#12/{lat}/{lon}", 60 | "logo_css_class": "mapbox-logo", 61 | }, 62 | { 63 | "name": "Mapillary", 64 | "countries": ["all"], 65 | "link": "https://www.mapillary.com/app/?lat={lat}&lng={lon}&z=18.123926367677527&p=&mapStyle=mapbox_satellite", 66 | "logo_css_class": "mapillary-logo", 67 | }, 68 | { 69 | "name": "OpenStreetCam", 70 | "countries": ["all"], 71 | "link": "https://openstreetcam.org/map/@{lat},{lon},18z", 72 | "logo_css_class": "openstreetcam-logo", 73 | }, 74 | { 75 | "name": "OpenStreetMap", 76 | "countries": ["all"], 77 | "link": "https://www.openstreetmap.org/#map=18/{lat}/{lon}", 78 | "logo_css_class": "openstreetmap-logo", 79 | }, 80 | { 81 | "name": "SentinelHub", 82 | "countries": ["all"], 83 | "link": "https://apps.sentinel-hub.com/eo-browser/?lat={lat}&lng={lon}&zoom=18", 84 | "logo_css_class": "sentinelhub-logo", 85 | }, 86 | { 87 | "name": "SnapMap", 88 | "countries": ["all"], 89 | "link": "https://map.snapchat.com/@{lat},{lon},18z", 90 | "logo_css_class": "snapchat-logo", 91 | }, 92 | { 93 | "name": "Wikimapia", 94 | "countries": ["all"], 95 | "link": "https://wikimapia.org/#lang=en&lat={lat}&lon={lon}&z=18&m=w", 96 | "logo_css_class": "wikimapia-logo", 97 | }, 98 | { 99 | "name": "Yandex Maps", 100 | "countries": ["all"], 101 | "link": "https://yandex.com/maps/?l=sat&ll={lon},{lat}&z=19", 102 | "logo_css_class": "yandexmaps-logo", 103 | }, 104 | { 105 | "name": "Zillow", 106 | "countries": ["US", "CA"], 107 | "link": "https://www.zillow.com/homes/for_sale/globalrelevanceex_sort/{lat},{lon}/15_zm/", 108 | "logo_css_class": "zillow-logo", 109 | }, 110 | { 111 | "name": "ZoomEarth", 112 | "countries": ["all"], 113 | "link": "https://zoom.earth/#{lat},{lon},18z,sat", 114 | "logo_css_class": "zoomearth-logo", 115 | }, 116 | ] 117 | 118 | from_place = [ 119 | { 120 | "name": "Bing Maps", 121 | "countries": ["all"], 122 | "link": "https://www.bing.com/maps?q={search}", 123 | "logo_css_class": "bing-logo", 124 | }, 125 | { 126 | "name": "Google Maps", 127 | "countries": ["all"], 128 | "link": "https://www.google.com/maps?q={search}", 129 | "logo_css_class": "googlemaps-logo", 130 | }, 131 | { 132 | "name": "OpenStreetMap", 133 | "countries": ["all"], 134 | "link": "https://www.openstreetmap.org/search?query={search}", 135 | "logo_css_class": "openstreetmap-logo", 136 | }, 137 | { 138 | "name": "Twitter", 139 | "countries": ["all"], 140 | "link": "https://twitter.com/search?q=place:{place_id}", 141 | "logo_css_class": "twitter-logo", 142 | }, 143 | { 144 | "name": "Wikimapia", 145 | "countries": ["all"], 146 | "link": "http://wikimapia.org/#search={search}", 147 | "logo_css_class": "wikimapia-logo", 148 | }, 149 | { 150 | "name": "Yandex", 151 | "countries": ["all"], 152 | "link": "https://yandex.com/maps/?l=sat&mode=search&text={search}", 153 | "logo_css_class": "yandexmaps-logo", 154 | }, 155 | ] 156 | --------------------------------------------------------------------------------