tag:blogger.com,1999:blog-72349120394317337212024-03-08T04:33:57.407-08:00ÜbertechsSurvival Paladinhttp://www.blogger.com/profile/10739437766727343492noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7234912039431733721.post-77727377225870691262015-09-06T02:24:00.000-07:002015-09-06T02:26:49.502-07:00Some useful chrome extensions:<br />
<div>
<br /></div>
<div>
AdBlock<br />
<a href="https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en-US">https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en-US</a><br />
<br /></div>
<div>
New Tab Redirect</div>
<div>
<a href="https://chrome.google.com/webstore/detail/new-tab-redirect/icpgjfneehieebagbmdbhnlpiopdcmna?hl=en-US">https://chrome.google.com/webstore/detail/new-tab-redirect/icpgjfneehieebagbmdbhnlpiopdcmna?hl=en-US</a><br />
<br />
Nextvid Stopper for YouTube<br />
<a href="https://chrome.google.com/webstore/detail/nextvid-stopper-for-youtu/lhgkhlpecokabjdphcgfakhegiacmoca?hl=en-US">https://chrome.google.com/webstore/detail/nextvid-stopper-for-youtu/lhgkhlpecokabjdphcgfakhegiacmoca?hl=en-US</a><br />
<br /></div>
<div>
uBlock Origin</div>
<div>
<a href="https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en-US">https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en-US</a></div>
Survival Paladinhttp://www.blogger.com/profile/10739437766727343492noreply@blogger.com1tag:blogger.com,1999:blog-7234912039431733721.post-65815077967865098412011-06-27T13:05:00.000-07:002011-06-27T13:05:31.766-07:00Salesforce & Perl & Catalyst - Building a Listener for Outbound Messages<textarea cols="101" rows="80">package YOURPACKAGENAME::SFDC;
use strict;
use SOAP::Lite;
use Data::Dumper;
use Moose;
use namespace::autoclean;
use XML::Simple;
use WWW::Salesforce;
BEGIN {extends 'Catalyst::Controller'; }
sub index : Private {
my ($self, $c, $args) = @_;
# The xml comes in as a file format
my $FH = $c->request->body;
# If there is a file, slurp in the data
if($FH){
my $raw_xml = do { local $/; <$FH> };
my $xml_simple = XML::Simple->new( );
my $xml_hash = $xml_simple->XMLin($raw_xml, ForceArray => 1);
my $object = $xml_hash->{'soapenv:Body'}->[0]->{'notifications'}->[0]->{'Notification'}->[0]->{'sObject'}->[0];
my $type = $object->{'xsi:type'};
# App Type is Job Application
if($type =~ m/Job_Application/){
warn("Type is: Job Application");
my $application_hash = {
'last_modified_date' => $object->{'sf:LastModifiedDate'}->[0],
'name' => $object->{'sf:Name'}->[0],
'created_by' => $object->{'sf:CreatedById'}->[0],
'is_deleted' => $object->{'sf:IsDeleted'}->[0],
'candidate_id' => $object->{'sf:Candidate__c'}->[0],
'id' => $object->{'sf:Id'}->[0],
'cover_letter' => $object->{'sf:Cover_Letter__c'}->[0],
'status' => $object->{'sf:Status__c'}->[0],
'created_date' => $object->{'sf:CreatedDate'}->[0],
'last_modified_by' => $object->{'sf:LastModifiedById'}->[0],
'owner_id' => $object->{'sf:OwnerId'}->[0]
};
# You now have the data, do what you want with it
warn("===============================================");
warn(Dumper($application_hash));
warn("===============================================");
}
}
# Dump out the acknowledge.
my $response = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">
<Ack>true</Ack>
</notificationsResponse>
</soapenv:Body>
</soapenv:Envelope>';
# We now have it so you don't need to set the view type to none.
#$c->stash->{'view_type'} = 'None';
$c->response->body($response);
return();
}
__PACKAGE__->meta->make_immutable;
1;
</textarea>Survival Paladinhttp://www.blogger.com/profile/10739437766727343492noreply@blogger.com0tag:blogger.com,1999:blog-7234912039431733721.post-68742592110319146362011-06-27T12:43:00.000-07:002011-06-27T13:12:38.908-07:00Salesforce & Perl - Using WWW::SalesforceHere is a simple example of how to get started with salesforce.<br />
this script shows you how you can interact with salesforces backend and pull or push data to/from their db. If you look at the Salesforce.pm file you can see all the methods available.<br />
<br />
<textarea cols="101" rows="120">
#!/usr/bin/perl
use WWW::Salesforce;
use Data::Dumper;
use strict;
# ------------------------------------------------------------------------------------
# Security Token:
# -obtained at:
# http://login.salesforce.com and click Setup | My Personal Information | Reset Security Token.
#
# The security token will be emailed to whatever email address is associated to the username.
# When accessing salesforce.com either via a desktop client or the API from outside of your
# company's trusted networks:
#
# If your password = "mypassword"
# And your security token = "XXXXXXXXXX"
# You must enter "mypasswordXXXXXXXXXX" in place of your password
# ------------------------------------------------------------------------------------
my $username = 'your@email.com';
my $password = 'yourpass';
my $security_token = 'XXXXXXXXXXXXXXX';
my $pass_token = "$password$security_token";
# Log into salesforce
my $sforce = eval { WWW::Salesforce->login( username => $username, password => $pass_token ); };
die "Could not login to SFDC: $@" if $@;
# ------------------------------------------------------------------------------------
# Methods
# ------------------------------------------------------------------------------------
# sub new # -- deprecated, use login
# sub convertLead # -- Converts a Lead into an Account, Contact, or (optionally) an Opportunity
# sub create # -- Adds one or more new individual objects to your organization's data (requires type)
# sub delete # -- Deletes one or more individual objects from your org's data (200max)
# sub describeGlobal # -- Retrieves a list of available objects for your organization's data
# sub describeLayout # -- retrieve information about the layout (presentation of data to users) for a given object type.
# sub describeSObject # -- Describes metadata (field list and object properties) for the specified object.
# sub describeSObjects # -- An array-based version of describeSObject;
# sub describeTabs # -- returns information about the standard apps and custom apps
# sub get_client # -- get a client
# sub get_session_header # -- gets the session header
# sub getDeleted # -- Retrieves the list of individual objects that have been deleted within the given timespan for the specified object.
# sub getServerTimestamp # -- Retrieves the current system timestamp (GMT) from the Web service.
# sub getUpdated # -- Retrieves the list of individual objects that have been updated (added or changed) within the given timespan
# sub getUserInfo # -- Retrieves personal information for the user associated with the current session
# sub login # -- logs a user into Sforce and returns a WWW::Salesforce object or 0
# sub query # -- runs a query against salesforce (500 limit default)
# sub queryAll # -- runs a query against salesforce including archived and deleted objects
# sub queryMore # -- query from where you last left off
# sub resetPassword # -- reset your password
# sub retrieve # -- Retrieves one or more objects based on the specified object IDs.
# sub search # -- Executes a text search in your organization's data.
# sub setPassword # -- Sets the specified user's password to the specified value.
# sub update # -- Updates one or more existing objects in your organization's data. (requires type, id)
# sub upsert # -- Creates new objects and updates existing objects;
# ------------------------------------------------------------------------------------
# -----------------------------------------
# Show Tables
# -----------------------------------------
my $results = eval { $sforce->describeGlobal(); };
print Dumper($results->result->{'types'});
# -----------------------------------------
# -----------------------------------------
# Select contacts
# -----------------------------------------
my $query = "select FirstName, LastName, Name, Email, HomePhone, Phone from Contact";
my $results = eval { $sforce->query( query => $query); };
print Dumper($results->result);
foreach my $record (@{$results->result->{'records'}}){
print Dumper($record);
}
# -----------------------------------------
# -----------------------------------------
# Describe Table
# (if you did the example app, you can see the table structure with this)
# -----------------------------------------
my $results = eval { $sforce->describeSObject( type => 'Job_Application__c' ); };
if($@){
print $@ . "\n";
}
my $fields;
foreach my $hash (@{$results->result->{'fields'}}){
my $label = $hash->{'label'};
my $name = $hash->{'name'};
$fields->{$label} = $name;
}
print Dumper($fields);
</textarea>Survival Paladinhttp://www.blogger.com/profile/10739437766727343492noreply@blogger.com0tag:blogger.com,1999:blog-7234912039431733721.post-40718964896991552122011-06-27T01:24:00.000-07:002011-06-27T01:24:33.104-07:00Blog StartI've had this domain for some time, and it used to be a portal for tech support and technical documents related to a company i'm no longer with. I decided to re-purpose this address for Perl examples of things i'm working on. Sometimes while trying to implement things, it's hard to find examples in a way that fully explain whats going on. So i'm going to try to post helpful Perl code for people who might need this information one day.Survival Paladinhttp://www.blogger.com/profile/10739437766727343492noreply@blogger.com0