Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on Fbcmd.
# The scripts are obsolete: when facebook deleted the support for FSQL
# fbcmd stopped working.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/fbcmd.e>
#           or at <http://angg.twu.net/e/fbcmd.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.fbcmd-install»	(to "fbcmd-install")
# «.fbcmd»		(to "fbcmd")
# «.google-goups»	(to "google-goups")
# «.google-groups-1»	(to "google-groups-1")
# «.google-groups-2»	(to "google-groups-2")
# «.wiki»		(to "wiki")
# «.fbcmd2»		(to "fbcmd2")
# «.fql»		(to "fql")
# «.fbcmd-token»	(to "fbcmd-token")




#####
#
# fbcmd: installing
# 2014aug06
#
#####

# «fbcmd-install» (to ".fbcmd-install")

# (find-es "php" "php-5.6-on-wheezy")
# (find-es "php" "php-5.5-on-wheezy")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo apt-get install php5-cli php5-curl

php -r 'echo phpversion();'; echo
 # -> 5.5.7

php -r 'phpinfo();' | grep -i curl
 # -> /etc/php.d/curl.ini,

cd /tmp/
wget https://raw.github.com/dtompkins/fbcmd/master/fbcmd_update.php

     php fbcmd_update.php       |& tee ofu
sudo php fbcmd_update.php sudo  |& tee ofus
     php fbcmd_update.php

# (find-fline "~/.fbcmd/")
# (find-fline "~/.fbcmd/prefs.php")
# (find-fline "/usr/local/lib/fbcmd/")
# (find-fline "/usr/local/lib/fbcmd/fbcmd_update.php")

(code-c-d "fbcmd" "/usr/local/lib/fbcmd/")
;; (find-fbcmdfile "")
# (find-fbcmdgrep "grep -nirH -e json *")




#####
#
# fbcmd
# 2014jul22
#
#####

# «fbcmd» (to ".fbcmd")
# http://fbcmd.dtompkins.com/
# http://www.ubuntumanual.org/posts/585/how-to-use-facebook-through-the-command-line
# http://xmodulo.com/2014/01/access-facebook-command-line-linux.html ***

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-sh "fbcmd")
# (find-sh "fbcmd" "UPDATE  ")
fbcmd whoami
fbcmd events
fbcmd mywall
# (find-sh "fbcmd events")
# (find-sh "fbcmd friends")
# (find-sh "fbcmd fstatus 531689679")
# (find-sh "fbcmd fstream 531689679")
# (find-sh "fbcmd fstream 531689679")
# (find-sh "fbcmd stream")
# (find-sh "fbcmd fullpost 3")
# (find-sh "fbcmd albums")
# (find-sh "fbcmd apics 8")
# (find-sh "fbcmd fullpost 6544394785573044240")

# (find-sh "fbcmd recent")

America/Sao_Paulo

fbcmd
fbcmd go access
fbcmd go auth
fbcmd auth 9U6441
fbcmd auth AH3Q2M
fbcmd showperm

fbcmd post "Hello, world!"
fbcmd target peter post "Hello, Peter!"
fbcmd fstatus
fbcmd fonline
fbcmd stream
fbcmd comment 5 "This is funny"
fbcmd like 3
For a full list of commands, refer to the official documentation.

https://www.facebook.com/cmdlinepage

# (find-fline "/usr/local/bin/fbcmd")
# (find-fline "/usr/local/lib/fbcmd/fbcmd_update.php")
# (find-fline "/usr/local/lib/fbcmd/fbcmd.php")
# (find-fline "/usr/local/lib/fbcmd/facebook/")



#####
#
# discussion at google groups
# 2014aug07
#
#####

# «google-goups» (to ".google-goups")
# https://groups.google.com/forum/#!forum/fbcmd
# https://mail.google.com/mail/ca/u/0/#search/fbcmd/14760032b4263e9e
# (find-angg "fbcache/README")



# «google-groups-1» (to ".google-groups-1")
# https://groups.google.com/forum/#!topic/fbcmd/qrqPpnNNmAc

Downloading the textual content of Facebook URLs

Hi Fbcmd people,

is there a way to use fbcmd to download the (textual) content of
Facebook URLs like these?

https://www.facebook.com/sergio.martins.984991/posts/10152616093738086
https://www.facebook.com/jornalanovademocracia/photos/a.288492381220437.66632.187051701364506/679809862088685/
https://www.facebook.com/permalink.php?story_fbid=921476867869306&id=347772661906399
https://www.facebook.com/photo.php?fbid=10201336092313990&set=a.1569106477271.73917.1523735650

Something that would output what it got from FB in a raw-ish form -
JSON? - would be ideal. Any hints welcome, as I am trying to write a
set of scripts for caching texts posted to FB that I may want to
access quickly later... the code that converts URLs to local file
names is ready - the URLs above are associated to files with these
names,

posts_sergio.martins.984991_10152616093738086
photos_jornalanovademocracia_a.288492381220437.66632.187051701364506_679809862088685
pesfi_921476867869306_347772661906399
photofs_10201336092313990_a.1569106477271.73917.1523735650

but right now I the only ways I have to put contents into these files
- for playing with a prototype - is with cut-and-paste between a
browser and Emacs... which is not fun.

  Thanks in advance, cheers =),
    Eduardo Ochs
    eduardoochs@gmail.com
    https://www.facebook.com/eduardo.ochs
    http://angg.twu.net/



P.S.: here is a similar project that I am working on, which is keeping
local copies of videos: http://angg.twu.net/youtube-db/README.html

P.P.S.: I wrote "downloading" but what I really meant was "reading
from Facebook and outputting to stdout"...




# «google-groups-2» (to ".google-groups-2")
https://groups.google.com/forum/#!topic/fbcmd/qrqPpnNNmAc

A call to wget with my username, password, and a "-U
$MOZILLA_USER_AGENT" could work in theory, but even if the page did
not need any Javascript to render its initial contents it would be
hard to parse, some comments would be truncated, etc...

I did try to parse the html for a while, months ago, and also the
output of marking with ctrl-A the whole text of the page displayed in
the browser, and then copying-and-pasting that to an Emacs buffer...
both things were very frustrating, and I was stumbling all the time on
corner cases and on rules that I had to guess. Having the contents of
posts as JSON will probably make things much easier.

By the way: is it possible to load fbcmd's functions from "php5 -a"
and call its functions directly? I am using Debian stable, with php5.5
and php5-readline from http://packages.dotdeb.org/ , and I normally
run interactive programs from Emacs, using this trick here - the demo
starts at 0:16 -

  http://www.youtube.com/watch?v=Lj_zKC5BR64

but the interactive mode of "php5 -a" is a bit limited - for example,
autoloads don't work... it would certainly be much easier to just
run these things,

// See: https://graph.facebook.com/754664537913868
$p_url = 'https://www.facebook.com/vera.rodrigues.944023/posts/605622119554057';
$p_id = '754664537913868'
echo get_json_of_page_from_id($p_id);
echo get_json_of_page_from_url($p_url);

than to also have to implement command-line options for calling these
functions...

  Cheers, TIA &c =),
    Eduardo Ochs



2015apr30:
http://fbcmd.dtompkins.com/ R.I.P.
http://fbcmd1.dtompkins.com/





#####
#
# Wiki
# 2014aug25
#
#####

# «wiki» (to ".wiki")
# http://fbcmd.dtompkins.com/
# http://fbcmd.dtompkins.com/commands




#####
#
# fbcmd2
# 2014aug25
#
#####

# «fbcmd2» (to ".fbcmd2")
# (find-angg ".emacs" "php")
# (find-angg "bin/fbcmd2")
# (find-fline "/usr/local/lib/fbcmd/fbcmd2.php")
# (find-fbcmdfile "fbcmd2.php")

// (find-fbcmdfile "fbcmd2.php" "'STREAM'")
  AddCommand('HELLO',     '(say Hello)');

// (find-fbcmdfile "fbcmd2.php" "if ($fbcmdCommand == 'SAVEDISP')")
// (find-fbcmdfile "fbcmd2.php" "if ($fbcmdCommand == 'HELLO')")
  if ($fbcmdCommand == 'HELLO') {
    echo "Hello!\n";
  }

# (find-fbcmdfile "fbcmd2.php" "if ($fbcmdCommand == 'STREAM')")





#####
#
# FQL
# 2014aug25
#
#####

# «fql» (to ".fql")
# http://fbcmd.dtompkins.com/commands/fql
# http://wiki.developers.facebook.com/index.php/FQL
# http://developers.facebook.com/tools.php?api





#####
#
# fbcmd's token
# 2014sep01
#
#####

# «fbcmd-token» (to ".fbcmd-token")
# (find-fline "/usr/local/lib/fbcmd/fbcmd.php")
# (find-fline "/usr/local/lib/fbcmd/facebook/")
# (find-fbcmdfile "fbcmd.php")
# (find-fbcmdfile "facebook/")
# (find-angg ".fbcmd/")
# (find-angg ".fbcmd/sessionkeys.txt")
# (find-fbcmdfile "fbcmd.php" "[datadir]sessionkeys.txt")







# (find-fline "/usr/local/lib/fbcmd/")
# (find-fline "/usr/local/lib/fbcmd/fbcmd.php")









#  Local Variables:
#  coding:               utf-8-unix
#  End: