Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Cleaning code.

Luca Hammer lucahammer

💭
Cleaning code.
View GitHub Profile
View pvoutput_pv_bot.py
'''
MIT License
Copyright (c) 2022 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@lucahammer
lucahammer / voteswiper-to-gdf.py
Last active Aug 21, 2021
Python script to create a Gephi network from voteswiper.org data
View voteswiper-to-gdf.py
'''
Copyright 2021 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@lucahammer
lucahammer / tweets-jsonl-to-co-hashtag-gexf.py
Last active Oct 13, 2021
DMI Summerschool Deepfakes Co-Hashtag Network
View tweets-jsonl-to-co-hashtag-gexf.py
'''
Copyright 2021 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
@lucahammer
lucahammer / readme.txt
Created Oct 12, 2020
Readme of Twitter data export 2020-10-12
View readme.txt
INTRODUCTION
============
This archive was generated at the request of the following user:
- @username at the time the archive was generated: luca
- Account ID: 11985982
The easiest way to navigate your archive is to open the HTML renderer in a desktop web browser by double clicking the “Your archive” file included in the main folder once the archive is unzipped.
Note that the HTML renderer only works if the archive is less than 50GB. Also note that the HTML renderer only includes a subset of the data included in the archive. To see all the data included in the archive, please navigate the JSON files located in the “data” folder.
@lucahammer
lucahammer / multiprocessing-test.py
Created Feb 26, 2020
Testing python multiprocessing
View multiprocessing-test.py
from multiprocessing import Pool
import jsonlines
from datetime import datetime
def get_full_text(tweet):
if tweet['truncated']:
return(tweet['extended_tweet']['full_text'])
return (tweet['text'])
def dothings(tweets):
@lucahammer
lucahammer / perf_3900x_windows10.ipynb
Created Feb 26, 2020
Performance Test. Ryzen R9 3900X Windows 10
View perf_3900x_windows10.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucahammer
lucahammer / perf_4670k_windows10.ipynb
Created Feb 26, 2020
Performance Test. Intel i5 4670k at 4.5GHz Windows 10
View perf_4670k_windows10.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucahammer
lucahammer / perf_3900x_ubuntu.ipynb
Last active Feb 26, 2020
Performance Test. Ryzen 9 3900X Ubuntu 18.04
View perf_3900x_ubuntu.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucahammer
lucahammer / retweetnetwork.py
Last active Jul 16, 2021
Example script to create a dynamic network gexf file for Gephi from a jsonl file Article: https://lucahammer.com/?p=367
View retweetnetwork.py
'''
MIT License
Copyright (c) 2019 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@lucahammer
lucahammer / premiumapi.py
Last active Apr 6, 2021
Example script to collect old Tweets with the Twitter Premium Search API. Article: https://lucahammer.com/?p=350
View premiumapi.py
'''
MIT License
Copyright (c) 2019 Luca Hammer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is