Have you tried to write a Chatbot for messaging platforms like Facebook or Slack? It is quite cumbersome as each messaging platform has its own way of communicating with your application. Let us find out how to simplify this task and create an intelligent multi-platform Chatbot using PHP and BotMan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"#title" : { | |
color: 'black', | |
font: { fontFamily:'Arial', fontSize: '20dp', fontWeight:'bold' }, | |
left: '0', top: 0, | |
width: Titanium.UI.FILL, | |
textAlign: "center", | |
}, | |
"#subtitle" : { | |
color: 'gray', | |
font: { fontFamily:'Arial', fontSize: '14dp' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var moment = require("alloy/moment"); | |
function processRelativeTime(number, withoutSuffix, key, isFuture) { | |
var format = { | |
'm': ['eine Minute', 'einer Minute'], | |
'h': ['eine Stunde', 'einer Stunde'], | |
'd': ['ein Tag', 'einem Tag'], | |
'dd': [number + ' Tage', number + ' Tagen'], | |
'M': ['ein Monat', 'einem Monat'], | |
'MM': [number + ' Monate', number + ' Monaten'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localVariable; | |
exports.init = function( foo ) | |
{ | |
Ti.API.info( "I do stuff" ); | |
localVariable = foo; | |
}; | |
exports.helloWorld = function() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://packagist.org/packages/phpseclib/phpseclib | |
// composer require "phpseclib/phpseclib": "0.3.10" | |
$certData = base64_decode( OBTAINED_CERTIFICATE_BASE64_STRING_FROM_PLIST ); | |
$issuer = new File_X509(); | |
$cert = $issuer->loadX509( $certData ); | |
$exirationDate = $cert['tbsCertificate']['validity']['notAfter']['utcTime']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Exception; | |
use Illuminate\Database\Eloquent\Builder; | |
/** | |
* Use this trait if your model has a composite primary key. | |
* The primary key should then be an array with all applicable columns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mpociot\SlackBot; | |
class PizzaConversation extends Conversation | |
{ | |
protected $size; | |
protected $topping; | |
public function askSize() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Mpociot\BotMan\Drivers; | |
use Mpociot\BotMan\Answer; | |
use Mpociot\BotMan\Message; | |
use Mpociot\BotMan\Question; | |
use Illuminate\Support\Collection; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Alexa\Response\Response as AlexaResponse; | |
use Illuminate\Support\Collection; | |
use Mpociot\BotMan\Answer; | |
use Mpociot\BotMan\Drivers\Driver; | |
use Mpociot\BotMan\Interfaces\UserInterface; | |
use Mpociot\BotMan\Message; |