Skip to content

Instantly share code, notes, and snippets.

@pasindud
pasindud / sms.php
Created December 26, 2014 16:06
Ideamart SMS Snippet
<?php
$url="http://api.dialog.lk:8080/sms/send"
sendSMS($url,"Hello world","0771231234","APP_000001","password");
function sendSMS ($url,$message,$addresses,$appid,$password){
$req = array("message"=>$message,
"destinationAddresses"=>$addresses,
@pasindud
pasindud / ussd.php
Created December 26, 2014 16:07
Ideamart USSD Snippet
<?php
$url="http://localhost:7000/ussd/send";
sendUSSD($url,"APP_001","password","Hello World","tel:94771231234","1","mt-cont","440");
function sendUSSD($url,$appid,$password,$message,$address,$seesionid,$ussdOperation,$encoding)
{
$arrayField = array("applicationId" => $appid,
@pasindud
pasindud / subscription.php
Created December 26, 2014 16:08
Ideamart Subscription Snippet
<?php
$url = "http://api.dialog.lk:8080/subscription/send";
subcribe('APP_005755','asda',$address);
function subcribe($url,$appid,$pw,$sub){
$arrayField = array("applicationId" => $appid,
"password" => $pw,
@pasindud
pasindud / ideamart-query-base.php
Created January 11, 2015 15:08
Ideamart PHP API Query Base
$url = "https://api.dialog.lk/subscription/query-base";
base($url,'APPID','password');
function base($url,$appid,$pw){
$arrayField = array("applicationId" => $appid,
"password" => $pw
);
<?php
ini_set('max_execution_time', 300);//increasing the code running time
$connect = mysql_connect('127.0.0.1', 'username', 'password');
$query1 = "SELECT id, word FROM `word_list_comments_stage2`";
mysql_select_db("irajw");
$result1=mysql_query($query1);
@pasindud
pasindud / youubesearch.js
Last active August 29, 2015 14:14
termish youtube search
'use strict';
jQuery.get("https://gdata.youtube.com/feeds/api/videos?vq=pasindudesilva&alt=json",function(d){
stdout(null, d);
return true;
});
@pasindud
pasindud / youtube.json
Last active August 29, 2015 14:14
termish-youtube-search-definition.json
{
"name": "youtube",
"endpoints": ["gdata.youtube.com"],
"scriptUrl": "https://rawgit.com/pasindud/0f9b8a815808b030328c/raw/b93988bee67fe37dd131f589b899b81f3a235eb8/youubesearch.js"
}
{
"data":[
{
"prefix":[77,66],
"carrier":"dialog",
"area":"all"
}
]
{"url":"http:\/\/preview.php.net\/manual\/en\/phdoe-1425257537-function.json-decode.php","log":{"buildCmd":"cd '\/local\/web\/sites\/edit.php.net\/data\/phpdoc-all\/'; \/usr\/bin\/php doc-base\/configure.php --with-php='\/usr\/bin\/php' --generate='en\/reference\/json\/functions\/json-decode.xml'; \/local\/oldphp\/bin\/phd --package PHP --format php --memoryindex -d doc-base\/.manual.xml --output '\/local\/web\/sites\/edit.php.net\/data\/phpdoc-all-new\/output-830a8cb1741411744b00f13ee7c73a87\/'","buildLog":["configure.php: $Id: configure.php 335565 2015-01-02 18:12:51Z bjori $","PHP version: 5.3.10-1ubuntu3.14","","Checking for source directory... \/local\/web\/sites\/edit.php.net\/data\/phpdoc-all\/doc-base","Checking for output filename... \/local\/web\/sites\/edit.php.net\/data\/phpdoc-all\/doc-base\/.manual.xml","Checking whether to include CHM... no","Checking for PHP executable... \/usr\/bin\/php5","Checking for language to build... en","Checking whether the language is supported... yes","Checking for
@pasindud
pasindud / subs.php
Created April 13, 2015 03:55
Ideamart Subcription Notification
<?php
$notification = json_decode(file_get_contents('php://input'), true);
error_log($notification['status'],$notification['subscriberId']);