<commit_before># silverstripe-social
=======================

## Introduction

This is a simple social-media-sharer. It will use the API of the selected (currently, only Twitter yet) social media to post something.
Follow the instructions in your settings to get things working

## Maintainer Contacts

* Simon "Sphere" Erkelens `simon[at]casa-laguna[dot]net`

## Features

* Post to twitter. Example-code, taken from my [`silverstripe-newsmodule`](https://github.com/Firesphere/silverstripe-newsmodule):

````php
<?php
	public function onAfterWrite(){
		parent::onAfterWrite();
		$siteConfig = SiteConfig::current_site_config();
		/**
		 * This is related to another module of mine.
		 * Check it at my repos: Silverstripe-Social.
		 * It auto-tweets your new Newsitem. If the TwitterController exists ofcourse.
		 * You can do a lot of different configs here, but I strongly suggest to include the "Tweeted" boolean in your $db declaration.
		 * Otherwise, you might tweet everytime you change something, which can get quite annoying ;)
		 */
		if($this->Live && !$this->Tweeted && $siteConfig->TweetOnPost){
			if(class_exists('TwitterController')){
				TwitterController::postTweet($this->Title, $this->AbsoluteLink());
				$this->Tweeted = true;
				$this->write();
			}
		}
	}

````

## Lacks

* Support for all users instead of just one account
* Facebook
* And a lot more

## Installation

If you don't have a github account, just download:
 1. Click on the big "ZIP" button at the top.
 2. Extract the zip to your site-root
 3. Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Other option is to clone the repo into your site-root:
 1.  In your site-root, do `git clone https://github.com/Firesphere/silverstripe-social.git`. 
 2.  Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Although, I would like it if you forked and cloned, because if you do, you can help me by adding features and make pull-requests to improve this module!
 1.  Make a fork of this module.
 2.  In your site-root, do `git clone https://{your username}@github.com/{your username}/silverstripe-social.git`. 
 3.  Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Note, forking is NOT REQUIRED, only handy if you want to help out.<commit_msg>Readme updated to Facebook-functionality.<commit_after># silverstripe-social
=======================

## Introduction

This is a simple social-media-sharer. It will use the API of the selected (currently, only Twitter yet) social media to post something.
Follow the instructions in your settings to get things working

## Maintainer Contacts

* <NAME>" Erkelens `simon[at]casa-laguna[dot]net`

## Features

* Post to twitter. Example-code, taken from my [`silverstripe-newsmodule`](https://github.com/Firesphere/silverstripe-newsmodule):

````php
<?php
	public function onAfterWrite(){
		parent::onAfterWrite();
		$siteConfig = SiteConfig::current_site_config();
		/**
		 * This is related to another module of mine.
		 * Check it at my repos: Silverstripe-Social.
		 * It auto-tweets your new Newsitem. If the TwitterController exists ofcourse.
		 * You can do a lot of different configs here, but I strongly suggest to include the "Tweeted" boolean in your $db declaration.
		 * Otherwise, you might tweet everytime you change something, which can get quite annoying ;)
		 */
		if($this->Live && !$this->Tweeted && $siteConfig->TweetOnPost){
			if(class_exists('TwitterController')){
				TwitterController::postTweet($this->Title, $this->AbsoluteLink());
				$this->Tweeted = true;
				$this->write();
			}
		}
	}

````
For Facebook, I used this test-function in page.php and called it via mydomain.com/home/testFacebook
````php
<?php
	public function testFacebook(){
		FacebookController::postFacebook('New Message, hooray!');
	}
````

Please help me test!

## Lacks

* Support for all users instead of just one account
* Facebook
* And a lot more

## Installation

If you don't have a github account, just download:
 1. Click on the big "ZIP" button at the top.
 2. Extract the zip to your site-root
 3. Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Other option is to clone the repo into your site-root:
 1.  In your site-root, do `git clone https://github.com/Firesphere/silverstripe-social.git`. 
 2.  Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Although, I would like it if you forked and cloned, because if you do, you can help me by adding features and make pull-requests to improve this module!
 1.  Make a fork of this module.
 2.  In your site-root, do `git clone https://{your username}@github.com/{your username}/silverstripe-social.git`. 
 3.  Run in your browser - `www.example.com/dev/build` to rebuild the database. 

Note, forking is NOT REQUIRED, only handy if you want to help out.
{'fraction_non_alphanumeric': 0.11384615384615385, 'fraction_numerical': 0.003282051282051282, 'mean_word_length': 4.016460905349795, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1102148', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1416, 'n_words': 574}