Posts

Showing posts with the label Chrome

Sample code to upload a file to chatter feed using REST API

Image
Step 1: Download required files Download the following files from internet httpcomponents-client-4.2.3-bin.zip org.apache.commons.httpclient.jar From the files, I have added following JARS to my project in eclipse.    Screenshot from Ecclipse Step 2: Get Access Token Through Chrome Login to your Salesforce instance and navigate to Setup -> Create -> Apps.  Create a custom app and fill Client ID and CallBack URL (ex: http://www.google.com) in the following URL. Encode the CallBack URL before passing it as a parameter.  https:// <instance_name> .salesforce.com/services/oauth2/authorize?response_type=token&client_id= <Client_ID_Goes_Here> &redirect_uri= <CallBack_URL> Paste this URL in chrome In Developer Tool -> Network select "preserve log upon navigation" Load the page. We see below page. The page will take us to RemoteAccessAuthorizationPage.apexp which inturn will lea...

Chrome Extension - Interactive Scraper

Image
This is my attempt to write an Interactive Scraper. See the Robot Icon In Browser Action Icons How to use? 1. From browser, you can choose the DOM element to scraper time to time.  Click On Capture detail 2. Data is persisted in Indexed DB of Background Page.  3. Data can be viewed or deleted by clicking "View" link from Add-In. This is implemented using Data Tables (table plug-in for jQuery ) 4. Once configured, you can run the scraper by clicking on "Roll" button. It will take you through all the URL's and collect text from DOM path and capture a screen shot for your future reference.  Development Challenges:   I have faced a few development challenges while developing this.  1. Chrome Synchronous Message Passing: I faced this problem when trying to load the URL's in a tab one after another. After the URL is loaded, the scraper should collect the text from the DOM and update it in database. There are ...