parsefb

package module
v0.0.0-...-fceb8bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2018 License: Unlicense Imports: 11 Imported by: 0

README

===============================
Web Scrape Facebook Post in Go_
===============================

`Web Scrape`_ public facebook post in Go_ via goquery_.

Tested on:

  - `Ubuntu 16.10`_
  - `Go 1.7.5`_


UNLICENSE
+++++++++

Released in public domain. See UNLICENSE_.


References
++++++++++

.. [1] `GitHub - PuerkitoBio/goquery: A little like that j-thing, only in Go. <https://github.com/PuerkitoBio/goquery>`_ |godoc|

.. _Go: https://golang.org/
.. _Ubuntu 16.10: http://releases.ubuntu.com/16.10/
.. _Go 1.7.5: https://golang.org/dl/
.. _UNLICENSE: http://unlicense.org/
.. _goquery: https://github.com/PuerkitoBio/goquery
.. _Web Scrape: https://www.google.com/search?q=Web+Scrape

.. |godoc| image:: https://godoc.org/github.com/PuerkitoBio/goquery?status.png
   :target: https://godoc.org/github.com/PuerkitoBio/goquery

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlogspotAuthor

func GetBlogspotAuthor(doc *goquery.Document) (string, error)

func GetBlogspotContent

func GetBlogspotContent(doc *goquery.Document) (string, error)

func GetBlogspotSummary

func GetBlogspotSummary(doc *goquery.Document) (string, error)

func GetBlogspotTags

func GetBlogspotTags(doc *goquery.Document) (string, error)

func GetBlogspotTimeStamp

func GetBlogspotTimeStamp(doc *goquery.Document) (string, error)

func GetBlogspotTitle

func GetBlogspotTitle(doc *goquery.Document) (string, error)

func GetBlogspotUrl

func GetBlogspotUrl(doc *goquery.Document) (string, error)

func GetContent

func GetContent(doc *goquery.Document) (string, error)

func GetImageUrl

func GetImageUrl(doc *goquery.Document) (string, error)

func GetTemplatePath

func GetTemplatePath(post *FBPostData) (tmplpath, filename string)

func GetTimeStamp

func GetTimeStamp(doc *goquery.Document) (string, error)

func ParseTimeStamp

func ParseTimeStamp(utime string) (string, error)

func QuerySelector

func QuerySelector(s object, selector string) *goquery.Selection

func SaveRst

func SaveRst(filepath, rst string) error

func SetRstDocTitleWidth

func SetRstDocTitleWidth(s string) (r string, err error)

First two line of the string may look like:

Hello World
#######

will become

Hello World
###########

after processing of this func

func TitleWidth

func TitleWidth(t string) int

func ToreStructuredText

func ToreStructuredText(post *FBPostData, tmplpath string) (string, error)

Types

type FBPostData

type FBPostData struct {
	PostUrl     string
	TimeStamp   string
	ProfileLink *ProfileLink
	ImageUrl    string
	Content     string
	Summary     string
	Title       string
	Author      string
	Tags        string
}

func Parse

func Parse(url string) (*FBPostData, error)

func ParseBlogspotPost

func ParseBlogspotPost(doc *goquery.Document) (*FBPostData, error)

func ParsePost

func ParsePost(s, posturl string) (*FBPostData, error)
type ProfileLink struct {
	Name string
	Url  string
}
func GetProfileLink(doc *goquery.Document) (*ProfileLink, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL