Skip to content

Instantly share code, notes, and snippets.

View lmfrossard's full-sized avatar
🎯
Focusing

L. Frossard lmfrossard

🎯
Focusing
  • Rio de Janeiro - Brazil
View GitHub Profile
@Gandi24
Gandi24 / sonia.py
Created September 13, 2017 22:55
Using facebook graph api, sum up all the highest bids in all the comments
import facebook #pip install facebook_sdk
import requests
import re
TOKEN = ""
GROUP_ID = '151115205479145'
nums = re.compile(r"[+-]?\d+(?:[\.\,]\d+)?")
@lschmierer
lschmierer / scrape_fb_event_attendants.py
Created June 7, 2017 13:03
Facebook Event Attendant scraper
#!/usr/bin/env python
import sys
import json
import requests
# Usage
# ./scrape_fb_events_attendants.py event_id access_token | tr "}" "\n" | grep "Name to Search"
# access_token: https://developers.facebook.com/tools/explorer/
def main():
event_id = sys.argv[1]
@kstohr
kstohr / fb_group_page_query.py
Last active December 20, 2021 18:33
Facebook Graph API: Search for pages and groups that match a query list
import os
import traceback
import logging
import facebook
import requests
import pandas as pd
import json
import time
import numpy as np
from pandas.io.json import json_normalize
@cezar08
cezar08 / Algoritmos exercícios
Created February 24, 2017 23:54
Algoritmos exercícios
1. Faça um programa que peça dois números ao usuário e mostre qual o maior e qual o menor.
2. Faça um programa que receba três inteiros e diga qual deles é o maior e qual o menor.
3. Escreva um programa que recebe um inteiro e diga se é par ou ímpar.
4. Para doar sangue é necessário ter entre 18 e 67 anos. Faça um aplicativo que pergunte a idade de uma pessoa e diga se ela pode doar sangue ou não.
5. Escreva um programa que pergunte o dia, mês e ano do aniversário de uma pessoa e diga se a data é válida ou não. Caso não seja, diga o motivo. Suponha que todos os meses tem 31 dias e que estejamos no ano de 2014.
@todmephis
todmephis / autotag_v1.0.py
Created February 22, 2017 19:15
Tag automatically your friends on Facebook post using python. | Etiqueta automaticamente a tus amigos en un post de Facebook usando python.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Autotag Facebook V 1.0
Copyright (C) 2017 todmephis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@darthsuogles
darthsuogles / fb_graph_api_calls.py
Last active November 8, 2017 18:46
Get Facebook graph API calls
from time import sleep
from random import randint
import json
import requests
import pandas as pd
def fb_graph_api_crawl(params, **kws):
print('initial call')
res = requests.get('https://graph.facebook.com/v2.8/search', params).json()
_js_list = [res['data']]
@Sephyros
Sephyros / lista_1_algoritmos.py
Created March 1, 2016 12:20
Lista de exercícios de Algoritmos
# Autor: Leonardo Vinicius Maciel
# Exercícios de Pseudocódigo convertidos para python
# O Algoritmo está escrito de forma a ficar parecido com as regras de declaração e fluxo
# de pseudocódigo, por isso, muitas convenções do python foram quebradas, além de coisas
# desnecessárias, como por exemplo a declaração de variáveis e o print antes do input (a
# string pode ser passada diretamente como parametro do input). O código também
# representa apenas uma das inúmeras possibilidades de resolução.
import math
@joseluisq
joseluisq / test_node_facebook_graph_insights.js
Created February 24, 2016 23:48
Node test for Facebook Graph Insights
const FB = require('fb');
const moment = require('moment');
const options = {
appId: '',
version: 'v2.5',
appSecret: '',
scope: 'user_about_me,publish_actions,read_insights',
redirect_uri: 'http://localhost:3000/login/callback'
};

10 Scala One Liners to Impress Your Friends

Here are 10 one-liners which show the power of scala programming, impress your friends and woo women; ok, maybe not. However, these one liners are a good set of examples using functional programming and scala syntax you may not be familiar with. I feel there is no better way to learn than to see real examples.

Updated: June 17, 2011 - I'm amazed at the popularity of this post, glad everyone enjoyed it and to see it duplicated across so many languages. I've included some of the suggestions to shorten up some of my scala examples. Some I intentionally left longer as a way for explaining / understanding what the functions were doing, not necessarily to produce the shortest possible code; so I'll include both.

1. Multiple Each Item in a List by 2

The map function takes each element in the list and applies it to the corresponding function. In this example, we take each element and multiply it by 2. This will return a list of equivalent size, compare to o

@tkarabela
tkarabela / postsfilter.user.js
Last active November 8, 2017 18:28
Facebook Posts Filter
// ==UserScript==
// @name Facebook Posts Filter
// @description Regex-based filter for Facebook posts, comments and likes.
// @version 1.3
// @namespace https://github.com/tkarabela
// @include http://*.facebook.com/*
// @include https://*.facebook.com/*
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue