Skip to content

Instantly share code, notes, and snippets.

@tenadavila
Created November 3, 2013 17:09
Show Gist options
  • Save tenadavila/7292403 to your computer and use it in GitHub Desktop.
Save tenadavila/7292403 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:facebook="http://www.mulesoft.org/schema/mule/facebook" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/facebook http://www.mulesoft.org/schema/mule/facebook/current/mule-facebook.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<facebook:config-with-oauth name="Facebook" appId="APP IDE AQUI" appSecret="APPSECRET AQUI" scope="user_photos" doc:name="Facebook">
<facebook:oauth-callback-config domain="localhost" localPort="8081" remotePort="8081"/>
</facebook:config-with-oauth>
<flow name="Authorize" doc:name="Authorize">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" doc:name="HTTP"/>
<facebook:authorize config-ref="Facebook" doc:name="Authorize"/>
<set-session-variable variableName="accessTokenId" value="#[flowVars['OAuthAccessTokenId']]" doc:name="Save Access Token"/>
<flow-ref name="PhotoDownload" doc:name="Flow Reference"/>
</flow>
<flow name="PhotoDownload" doc:name="PhotoDownload">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<not-filter doc:name="Not">
<wildcard-filter pattern="/favicon.ico" caseSensitive="true"/>
</not-filter>
<facebook:get-user-picture config-ref="Facebook" user="me" accessTokenId="#[sessionVars['accessTokenId']]" doc:name="Facebook" type="large"/>
<file:outbound-endpoint path="F:\Master\Integracion\raws" outputPattern="fotoperfil.jpeg" responseTimeout="10000" doc:name="File"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment