Skip to content

Commit 467f1fb

Browse files
changed some stuff for optimisation, fixed some errors, changed README
1 parent fff43f6 commit 467f1fb

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ENV
2+
ghostdriver.log
3+
phantomjs.exe

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
# FbPostUsingPython
2-
>It is a small script to post status on your FB wall using python..!
2+
>It is a small script to post status on your FB wall using python
33
4-
#Installation
5-
1- Install python 3.5 from [Python.org](https://www.python.org)
4+
# Installation
5+
* Install python 3 from [Python.org](https://www.python.org)
66

7-
2- `sudo apt-get install python3-pip` (For Ubuntu Users)
7+
* Install pip `$ sudo apt-get install python3-pip` (For Ubuntu Users)
88

9-
3- `python setup.py` or `python3 setup.py`
9+
* `$ python setup.py` or `$ python3 setup.py`
1010

11-
This will install all these packages
11+
* Download [PhantonJS](http://phantomjs.org/download.html) and copy the exe file into the same folder as your repository
1212

13-
* `pip install bs4`
13+
After the installation, open terminal at the root folder
1414

15-
* `pip install selenium`
15+
Run `python fb.py` or `python3 fb.py` to post status from terminal or cmd.
1616

17-
After the installation, open terminal at the root folder--
17+
Note:- Use Mozilla Firefox V40.0+ to make this script work for you.
1818

19-
Run `python fb.py` or `python3 fb.py` to post status from terminal or cmd.
2019

21-
Note:- Use Mozilla Firefox V40.0 to make this script work for you.
2220

23-
##Some Useful Installation Tips ( Ubuntu )
21+
## Some Useful Installation Tips ( Ubuntu )
2422

25-
If you have already installed python 2.7 install python 3 as well but it may be the problem that the packages installed with respect to python 2.7 and shows error for the python 3 packages,
23+
If you have already installed python 2.7 install python3 as well but it may be the problem that the packages are installed with respect to python 2.7 and shows error for the python 3 packages,
2624

27-
So you need to install virtual Environment for the python 3 to install python3 packages.
25+
So, you need to install a Virtual Environment for the python3 to install python3 packages.
2826

2927
```
3028
virtualenv -p /usr/bin/python3 py3env
@@ -34,7 +32,7 @@ So you need to install virtual Environment for the python 3 to install python3 p
3432

3533
After setting virtual environment install packages listed above and Enjoy.
3634

37-
#License
35+
# License
3836

3937
Copyright (c) 2016 Ankit Jain - Released under the Apache License
4038

fb.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import time
2-
import platform
2+
import os
33
import getpass
44
import selenium
55
from selenium import webdriver
@@ -11,19 +11,19 @@
1111
def get_title(driver):
1212
html_page = driver.page_source
1313
soup = BeautifulSoup(html_page,'html.parser')
14-
print(soup.title.string+"\n")
14+
# print(soup.title.string+"\n")
1515
return soup.title.string
1616

17-
if platform.system() == 'Windows':
18-
pathr = 'C:\\Program Files\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe'
17+
if os.name == 'nt':
18+
pathr = 'phantomjs.exe'
1919
else:
2020
pathr = './phantomjs'
2121
driver = webdriver.PhantomJS(pathr, service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any'])
2222
url = "https://mbasic.facebook.com/"
2323

2424
while True:
2525
driver.get(url)
26-
time.sleep(2)
26+
# time.sleep(2)
2727
get_title(driver)
2828

2929
eMail = input("Enter your Email Id or Mobile No. to Login\n")
@@ -36,7 +36,7 @@ def get_title(driver):
3636

3737
login = driver.find_element_by_name("login")
3838
login.click()
39-
time.sleep(5)
39+
# time.sleep(5)
4040

4141

4242
if get_title(driver) != "Log in to Facebook | Facebook":
@@ -50,7 +50,7 @@ def get_title(driver):
5050
status.send_keys(pp)
5151
button = driver.find_element_by_name("view_post")
5252
button.click()
53-
time.sleep(5)
53+
# time.sleep(5)
5454
print("Your Status : '"+pp+"' has been uploaded!\n")
5555
driver.quit()
5656
break

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy