This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import random | |
max_population = 10 | |
iterations = 100000 | |
for n in range(2, max_population): | |
probability = 1.0/n | |
success_count, fail_count = 0, 0 | |
success_rounds, fail_rounds = [], [] | |
for j in range(iterations): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
turuncu | % | mavi | % | mor | % | yeşil | % | |
---|---|---|---|---|---|---|---|---|
Sözcü | 27.5 | Sözcü | 59.4 | NTV Spor | 23.8 | Bugün TV | 55.4 | |
halktv.com.tr | 23.5 | Cumhuriyet | 58.6 | NTV | 19.4 | ÜLKÜCÜ MEDYA | 52.0 | |
Haberturk | 15.7 | Odatv | 55.3 | CNN Türk | 18.2 | NTV | 28.2 | |
CNN Türk | 15.7 | BBC Türkçe | 50.4 | BBC Türkçe | 17.8 | CNN Türk | 28.2 | |
BBC Türkçe | 15.7 | Diken | 50.0 | teyit | 17.1 | Sözcü | 27.6 | |
Hurriyet.com.tr | 13.7 | BirGün Gazetesi | 46.6 | Hurriyet.com.tr | 15.0 | Son Dakika Türk | 24.8 | |
NTV | 13.7 | CNN Türk | 46.6 | Sputnik Türkiye | 14.7 | Hurriyet.com.tr | 21.4 | |
Sputnik Türkiye | 13.7 | T24 | 45.1 | Haberturk | 11.9 | Haberturk | 19.4 | |
Al Jazeera Türk | 13.7 | Sputnik Türkiye | 43.2 | Sözcü | 11.7 | Diken | 18.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genel | % | medya | % | |
---|---|---|---|---|
Meral Akşener | 82.51 | NTV Spor | 28.21 | |
Fatih Portakal | 53.11 | NTV | 25.85 | |
Cem Yılmaz | 52.96 | BBC Türkçe | 24.35 | |
Prof. Dr. Ümit Özdağ | 50.73 | CNN Türk | 24.26 | |
İlber Ortaylı | 45.05 | Sözcü | 23.53 | |
Muharrem İNCE | 44.82 | Hurriyet.com.tr | 21.97 | |
Sinan Oğan | 44.08 | Cumhuriyet | 20.57 | |
Kemal Kılıçdaroğlu | 43.97 | Odatv | 20.37 | |
Ahmet Hakan | 40.22 | Sputnik Türkiye | 18.89 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
medya | % | |
---|---|---|
NTV Spor | 28.21 | |
NTV | 25.85 | |
BBC Türkçe | 24.35 | |
CNN Türk | 24.26 | |
Sözcü | 23.53 | |
Hurriyet.com.tr | 21.97 | |
Cumhuriyet | 20.57 | |
Odatv | 20.37 | |
Sputnik Türkiye | 18.89 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
medya | % | |
---|---|---|
NTV Spor | 28.21 | |
NTV | 25.85 | |
BBC Türkçe | 24.35 | |
CNN Türk | 24.26 | |
Sözcü | 23.53 | |
Hurriyet.com.tr | 21.97 | |
Cumhuriyet | 20.57 | |
Odatv | 20.37 | |
Sputnik Türkiye | 18.89 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
turuncu | % | mavi | % | mor | % | yeşil | % | |
---|---|---|---|---|---|---|---|---|
Sözcü | 27.5 | Sözcü | 59.4 | NTV Spor | 23.8 | Bugün TV | 55.4 | |
halktv.com.tr | 23.5 | Cumhuriyet | 58.6 | NTV | 19.4 | ÜLKÜCÜ MEDYA | 52.0 | |
Haberturk | 15.7 | Odatv | 55.3 | CNN Türk | 18.2 | NTV | 28.2 | |
CNN Türk | 15.7 | BBC Türkçe | 50.4 | BBC Türkçe | 17.8 | CNN Türk | 28.2 | |
BBC Türkçe | 15.7 | Diken | 50.0 | teyit | 17.1 | Sözcü | 27.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# instagram endpoint that would return the users who have liked a post | |
endpoint = 'https://www.instagram.com/graphql/query/?query_id=17864450716183058&variables=%s' | |
likers = [] | |
for shortcode in shortcodes: | |
url = endpoint % json.dumps({ | |
'shortcode': shortcode, | |
'first': 1000, # fetch the last 1,000 likers; you should paginate through results to fetch all likers | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import json | |
import requests # pip install requests | |
profile_pat = re.compile('<script type="text/javascript">window\._sharedData = (.*);</script>') | |
username = 'onurmatik' # instagram username to check its posts | |
# The exception handling is excluded for brevity | |
response = requests.get('https://www.instagram.com/%s/' % username) | |
match = profile_pat.findall(response.text) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import urllib | |
# 'usernames.txt' contains a list of Twitter usernames; one at each line | |
f = open('usernames.txt') | |
# Photo addresses are saved into 'images.txt' | |
out = open('images.txt', 'w') | |
# for each username, the photo file itself is save under 'photo/' folder |