Skip to content

SMS API to Send SMS from Way2Sms on May – Part 4

Hi Guys,

Way2sms updating their sites for security reason. They are not providing any API to send SMS from their gateway. Due that reason we have some issues in past, in future also they will change. There is no guarantee for this API will work for a long.

After analysis of way2sms website,  this sms API have been developed this code to send SMS from way2sms website. In this program we are using CURL to communicate with way2sms website and sending SMS from our API. Curl is a command line tool for transferring data with URL. Using Curl we can post data to the targeted URL.

Prerequisites:

  • Curl need to enable in our machine.
  • Way2sms account needed to send sms.

Things need to remember before trying to send SMS:

  1. We are using Curl method, With helps the user to login into the Way2sms application and sending SMS from it.
  2. In Curl, we are storing the token information in cookie file, so that make the cookie file path as writable one. Else the you can’t send SMS. Currently we are storing cookie file path in temp directory.
  3. Every user has unique identification Id, Way2SMS will validate that key before sending the SMS.
  4. While try to send SMS from Way2sms, it must match the following criteria username, password and identification id.

Steps to send sms:

  1. Download the sendsmsV3.5 via Way2SMS file.
  2. Extract the downloaded files into your web directory.
  3. Replace the exact values in the following URL to send SMS using our API, http://<webserverpath>/?username=XXXXXXXX&password=XXXXXXXXX&receiver=XXXXXXXXXX&message=XXXXXXXXXXXX

Version 3.5, released on May 2013 (updated on 1st)

sendsmsV3.5 via Way2SMS

SMS Desktop application (OsSMS)

Os SMS Client which help us to send unlimited SMS from different free sms service providers. This application will reduce the complication of sending sms from website.

Features:

  1. Multiple SMS providers (Way2SMS, 160By2), Currently we are supporting Way2sms,160by2,Fullonsms.

One time configuration for each SMS provider.Its support cross platform, you can use it any OS (windows, linux, Mac).

prerequisite:

To install this OsSMS client in your machine, you need to install adobe air.

For Windows & Mac:

Download Adobe air executable file and install on your windows/Mac machine.

Adobe air

For Linux:

Follow the steps in the below link, which helps you to install adobe air on your linux machine.

Adobe air

OsSMS Client Download:

Version: 0.0.1 has been removed

OsSMS Client Version 0.0.2

Connect MS SQL Server with Rails

To connect MS SQL Server with Ruby on Rails follow the below steps:

SQL Server (2005 or higher recommended)

Install the adapters and driver

   gem install tiny_tds
   gem install activerecord-sqlserver-adapter

Ensure the activerecord adapter and db driver gems are defined in your Gemfile

   gem 'tiny_tds'
   gem 'activerecord-sqlserver-adapter'

Unable to create rails application with sqlserver

Could not find “config/databases/sqlserver.yml” in any of your source paths.

Your current source paths are:
$HOME/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/generators/rails/app/templates

Error:

Template sqlserver.yml file missing.

Solution:

Need to update sqlserver.yml file in the specific location to fix this issue.

Step1: Download sqlserver.yml configuration file.

Step2: Extract the downloaded zip file.

Step3: Copy extracted sqlserver.yml configuration file into the location which thrown error while creating sqlserver database rails application.

i.e,

$HOME/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml

Step4: Now create new rails application with database as sqlserver

rails new sqlserverProj -d sqlserver

It will create rails application without any error.

YII – set default settings within module and controller

Which helps to overwrite default settings of module and controller. To set default controller, view, layout and theme.

Set default controller within module

[php]
/**
* @var string the default controller.
*/

public $defaultController = ‘controller_name’;
[/php]

To Set default layout, theme and views within controller, use the following commands.

[php]
/**
* @var string the default layout and view/action.
*/
public $layout = ‘layout_name’;
public $defaultAction = ‘action_name’;

/**
* @var string the default theme.
*/
Yii::app()->theme =’theme_name’;
[/php]

Installing Django on Ubuntu

About Django:

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Developed by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Optional installations:

There are a number of optional packages that can be used with Django. Run the following command to install the optional packages.

sudo aptitude install python-imaging python-pythonmagick python-markdown python-textile python-docutils

If you want more information about the package then use ‘show’ subcommand with the respective package name.

aptitude show python-imaging

These packages are optional and frequently used. So it’s up to you if you want to use them with Django or not.

Installing Django with Aptitude:

To date, this is not the recommended way of installing Django as it comes with an older version. However, if you still want to follow this method, you can use this command

sudo aptitude install python-django

Once it has download, you can check that Django is installed and working.

django-admin

The prompt will show the line below, followed by a long set of options.

Usage: django-admin subcommand [options] [args]

Installing Django without Aptitude:

If you don’t want to use aptitude, then this is your best bet for installing Django. In this method, we will download the official stable release and install it manually.

wget https://www.djangoproject.com/download/1.4/tarball/
tar xzvf index.html
cd Django-1.4
sudo python setup.py install

You can use this command to check that Django is installed and working

django-admin.py

You should get below response, and it will be followed by a long set of options.

Usage: django-admin subcommand [options] [args]

Installing Django from the Git Repository:

If you are looking for the latest release of Django that supports all major features, then download the program through git.

Before you start, you need to download git:

apt-get install git-core

Once it downloads, you can install Django:

git clone https://github.com/django/django.git

How to automate whodidit behaviour and timestamps in yii ActiveRecord model?

To automate whodidit and timestamps in yii activerecord model using beforesave() method. If the rule validation got success then only the beforesave() method will invoke. Without satisifying rule() in activerecord model, this method will not work.

[php]
protected function beforeSave() {
if(parent::beforeSave()) {
if($this->isNewRecord) {
$this->created_on = time();
$this->created_by = (int)Yii::app()->user->id;
}
$this->updated_on = time();
$this->updated_by = (int)Yii::app()->user->id;
return true;
} else return false;
}
[/php]

Follow

Get every new post delivered to your Inbox.

Join 258 other followers