bhamodi / facebook-online-friend-tracker Goto Github PK
View Code? Open in Web Editor NEWTrack the number of online friends you have on Facebook at any given time!
License: MIT License
Track the number of online friends you have on Facebook at any given time!
License: MIT License
Hi, firstly thanks for creating this script, very good idea :)
I will test here now, but I have a problem...
I did the setup following the instructions, I installed Python and the package via PIP, but when I try to run the script command the terminal return that command not found, see:
$ facebook-online-friend-tracker
-bash: facebook-online-friend-tracker: command not found
Ideas how solve it?
Thanks in advance!
Hi,
I tried the code on mac, and it created a csv file itself, but the problem is that it always gets 0 friends online, which is not true. Do not know where the problem is, maybe the code tries to find something that facebook changed. Let me know if you know what issue it could be.
Eee
I'm encountering the following error:
Initializing Chrome WebDriver...
Traceback (most recent call last):
File "/usr/local/bin/facebook-online-friend-tracker", line 9, in <module>
load_entry_point('facebook-online-friend-tracker==2.0.0', 'console_scripts', 'facebook-online-friend-tracker')()
File "/usr/local/lib/python2.7/dist-packages/src/main.py", line 68, in main
driver = webdriver.Chrome()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 62, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0xe6fa50>> ignored
Any hint about what is causing this?
Initializing Chrome WebDriver...
Logging into Facebook...
Waiting for Facebook to update friends list... (This takes approximately 3 minutes.)
Done! Detected 0 online friends.
Added: 2016/09/19 00:19:41 -> 0 to the spreadsheet.
Waiting for Facebook to update friends list... (This takes approximately 3 minutes.)
Done! Detected 0 online friends.
Added: 2016/09/19 00:22:43 -> 0 to the spreadsheet.
Waiting for Facebook to update friends list... (This takes approximately 3 minutes.)
Done! Detected 0 online friends.
Added: 2016/09/19 00:27:43 -> 0 to the spreadsheet.
Waiting for Facebook to update friends list... (This takes approximately 3 minutes.)
Done! Detected 0 online friends.
Added: 2016/09/19 00:32:43 -> 0 to the spreadsheet.
Waiting for Facebook to update friends list... (This takes approximately 3 minutes.)
Thanks for your script!
I try to run it on Mac and I get:
Waiting for Facebook to update friends list... (This takes approximately 2 minutes.)
Traceback (most recent call last):
File "/usr/local/bin/facebook-online-friend-tracker", line 9, in
load_entry_point('facebook-online-friend-tracker==1.2.0', 'console_scripts', 'facebook-online-friend-tracker')()
File "/Library/Python/2.7/site-packages/src/main.py", line 72, in main
onlineFriendsCount = int(driver.find_element_by_xpath('//*[@id="fbDockChatBuddylistNub"]/a/span[2]/span').text.strip('()'))
ValueError: invalid literal for int() with base 10: ''
So I finally managed to get my hands on this awesome stuff, but my excitement ended after this error:
Starting script...
Verifying that the CSV file exists...
[WARNING] 'C:\fb.csv' does not exist. Creating a new CSV file now...
New CSV file created at: C:\Python27\Scripts\facebook_online_friend_tracker_data.csv
Initializing Chrome WebDriver...
Logging into Facebook...
Waiting for Facebook to update friends list... (This takes approximately 2 minutes.)
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\facebook-online-friend-tracker.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\src\main.py", line 75, in main
onlineFriendsCount = int(driver.find_element_by_xpath('//*[@id="fbDockChatBuddylistNub"]/a/span[2]/span').text.strip('()'))
ValueError: invalid literal for int() with base 10: ''
As it seems to work for others, I guess it's a problem in my folder structure or something similar ?
Thank you.
The script has worked fine for a few days, but now it always detects 0 friends online, even when it is clearly not the case. Any clue why this would happen?
Instead of using ChromeDriver which pops up a visible Chrome Browser, let's investigate what it would take to switch to PhantomJS to run headless.
Which configuration did you use?
I tried to run on a raspberry pi and a debian web server (without X)
I get the following error messages
Verifying that the CSV file exists...
[WARNING] test.csv does not exist. Creating a new CSV file now...
New CSV file created at: /home/pi/facebook_online_friend_tracker_data.csv
Initializing Chrome WebDriver...
Traceback (most recent call last):
File "/usr/local/bin/facebook-online-friend-tracker", line 9, in
load_entry_point('facebook-online-friend-tracker==1.2.1', 'console_scripts', 'facebook-online-friend-tracker')()
File "/usr/local/lib/python2.7/dist-packages/src/main.py", line 39, in main
driver = webdriver.Chrome()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 62, in init
self.service.start()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/service.py", line 68, in start
self.service_args, env=env, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
Initializing Chrome WebDriver...
Traceback (most recent call last):
File "/usr/local/bin/facebook-online-friend-tracker", line 9, in
load_entry_point('facebook-online-friend-tracker==1.2.1', 'console_scripts', 'facebook-online-friend-tracker')()
File "/usr/local/lib/python2.7/dist-packages/src/main.py", line 39, in main
driver = webdriver.Chrome()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 68, in init
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 89, in init
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 138, in start_session
'desiredCapabilities': desired_capabilities,
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 195, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 170, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Driver info: chromedriver=2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961),platform=Linux 3.13.0-54-generic x86_64)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.