<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Riccardo Branz on Medium]]></title>
        <description><![CDATA[Stories by Riccardo Branz on Medium]]></description>
        <link>https://medium.com/@riccardo-branz?source=rss-a7cb58df1fc8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*378-z3xieKwigeWGxS0a4w.jpeg</url>
            <title>Stories by Riccardo Branz on Medium</title>
            <link>https://medium.com/@riccardo-branz?source=rss-a7cb58df1fc8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:28:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riccardo-branz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Finding a word in a haystack]]></title>
            <link>https://riccardo-branz.medium.com/finding-a-word-in-a-haystack-c56d48348cc9?source=rss-a7cb58df1fc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c56d48348cc9</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[cool-stuff]]></category>
            <dc:creator><![CDATA[Riccardo Branz]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 19:04:49 GMT</pubDate>
            <atom:updated>2021-07-06T19:04:49.777Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I remembered an article I read a few years ago about Data Platform as a Service. I was very intrigued by it back then and I can remember saving it in my GetPocket page. However, when I tried to find it recently, I wasn’t able to. Probably, the title was not super obvious.</p><p>I had two options, let it go or build an over complex code that would find the article I was looking for.</p><p>I opted for the second one.</p><h3>My idea for a solution</h3><p>Despite having read the article so long ago, I could still remember/guess a few keywords it contained: <em>platform</em> and <em>data</em>.</p><p>So my idea was to fetch all the articles I saved in Get Pocket, scrape its content and look for those two words.</p><p>To do that I had to:</p><ol><li>connect to GetPocket’s API</li><li>get all articles (including the archived ones)</li><li>fetch each article’s content</li><li>look for the set of keywords in the text</li></ol><p>The final result should be a list of articles, which I could manually open and find: <strong>the one</strong>.</p><h3>Connecting to GetPocket</h3><p>For this project I wanted to use Python, and to connect to GetPocket’s API I could use a package someone had done already, but that wouldn’t be as fun and I wouldn’t learn so much with it, so I decided to connect to the API “on my own”.</p><h4>Authentication</h4><p>The first step is to authenticate our API calls, for that we need to get a <em>consumer key</em> in the <a href="http://getpocket.com/developer/apps/new">website</a>. To keep my code in Github safe, I’ll create an environment variable with the consumer key and retrieve it in the code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%252520os%25250A%25250ACONSUMER_KEY%252520%25253D%252520os.environ%25255B%2527POCKET_CONSUMER_KEY%2527%25255D&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%25252520os%2525250A%2525250ACONSUMER_KEY%25252520%2525253D%25252520os.environ%2525255B%252527POCKET_CONSUMER_KEY%252527%2525255D&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c842ed29ead4c9ee3bfdca5978b7612/href">https://medium.com/media/1c842ed29ead4c9ee3bfdca5978b7612/href</a></iframe><p>According to the <a href="https://getpocket.com/developer/docs/authentication">documentation</a>, we then need to:</p><ol><li>obtain a request token</li><li>get user to authorize the request token</li><li>get an access token</li></ol><p>Obtaining a request token is quite straightforward, we just send a POST request with the consumer key and a redirect uri in the header. The consumer_key we defined already, the redirect uri doesn’t really matter in this case, so you can put <a href="http://www.google.com/">www.google.com</a> or <a href="http://localhost:8080/">http://localhost:8080</a>. We will parse the response’s text by splitting the string at every occurrence of an equal (=) sign, giving us a list of [“code”, code value]. We will take the code value.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%252520requests%25250A%25250A%25250Adef%252520get_request_token%2528consumer_key%25253A%252520str%2529%252520-%25253E%252520str%25253A%25250A%252520%252520%252520%252520url%252520%25253D%252520%2527https%25253A%25252F%25252Fgetpocket.com%25252Fv3%25252Foauth%25252Frequest%2527%25250A%25250A%252520%252520%252520%252520res%252520%25253D%252520requests.post%2528url%25252C%252520data%25253D%25257B%2527consumer_key%2527%25253A%252520consumer_key%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%2527redirect_uri%2527%25253A%252520%2527http%25253A%25252F%25252Flocalhost%25253A8080%2527%25257D%2529%25250A%25250A%252520%252520%252520%252520if%252520res.status_code%252520%25253D%25253D%252520200%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520return%252520res.text.split%2528%2527%25253D%2527%2529%25255B1%25255D%25250A%252520%252520%252520%252520else%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520raise%252520Exception%2528f%252522Request%252520unsuccessful.%252520Reason%25253A%252520%25257Bres.headers%25255B%2527X-Error%2527%25255D%25257D%252522%2529&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%25252520requests%2525250A%2525250A%2525250Adef%25252520get_request_token%252528consumer_key%2525253A%25252520str%252529%25252520-%2525253E%25252520str%2525253A%2525250A%25252520%25252520%25252520%25252520url%25252520%2525253D%25252520%252527https%2525253A%2525252F%2525252Fgetpocket.com%2525252Fv3%2525252Foauth%2525252Frequest%252527%2525250A%2525250A%25252520%25252520%25252520%25252520res%25252520%2525253D%25252520requests.post%252528url%2525252C%25252520data%2525253D%2525257B%252527consumer_key%252527%2525253A%25252520consumer_key%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%252527redirect_uri%252527%2525253A%25252520%252527http%2525253A%2525252F%2525252Flocalhost%2525253A8080%252527%2525257D%252529%2525250A%2525250A%25252520%25252520%25252520%25252520if%25252520res.status_code%25252520%2525253D%2525253D%25252520200%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%25252520res.text.split%252528%252527%2525253D%252527%252529%2525255B1%2525255D%2525250A%25252520%25252520%25252520%25252520else%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520raise%25252520Exception%252528f%25252522Request%25252520unsuccessful.%25252520Reason%2525253A%25252520%2525257Bres.headers%2525255B%252527X-Error%252527%2525255D%2525257D%25252522%252529&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf94b5f2ee113c95a34e235559d6ad33/href">https://medium.com/media/bf94b5f2ee113c95a34e235559d6ad33/href</a></iframe><p>Authorizing the request token is a little bit trickier, we need to start a server which will wait until the user authorizes it before continuing to the next stage. For that we can use two libraries: <em>wsgiref</em> and <em>webbrowser</em>.</p><p>Wsgiref allows us to create a server that will wait until the user has authorized (or not) our application, and webbrowser will open the link so the user can authenticate the app.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfrom%252520wsgiref.simple_server%252520import%252520make_server%25252C%252520demo_app%25250Aimport%252520webbrowser%25250A%25250A%25250Adef%252520authorize_request_token%2528request_token%25253A%252520str%2529%252520-%25253E%252520None%25253A%25250A%252520%252520%252509server%252520%25253D%252520make_server%2528%2527localhost%2527%25252C%2525208080%25252C%252520demo_app%2529%25250A%252520%252520%252520%252520redirect_uri%252520%25253D%252520f%2527http%25253A%25252F%25252Flocalhost%25253A%25257Bserver.server_port%25257D%25252F%2527%25250A%252520%252520%252520%252520auth_url%252520%25253D%252520f%2527https%25253A%25252F%25252Fgetpocket.com%25252Fauth%25252Fauthorize%25253Frequest_token%25253D%25257Brequest_token%25257D%252526redirect_uri%25253D%25257Bredirect_uri%25257D%2527%25250A%25250A%252520%252520%252520%252520webbrowser.open%2528auth_url%25252C%252520new%25253D1%25252C%252520autoraise%25253DTrue%2529%25250A%25250A%252520%252520%252520%252520server.handle_request%2528%2529%25250A%252520%252520%252520%252520server.server_close%2528%2529&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfrom%25252520wsgiref.simple_server%25252520import%25252520make_server%2525252C%25252520demo_app%2525250Aimport%25252520webbrowser%2525250A%2525250A%2525250Adef%25252520authorize_request_token%252528request_token%2525253A%25252520str%252529%25252520-%2525253E%25252520None%2525253A%2525250A%25252520%25252520%25252509server%25252520%2525253D%25252520make_server%252528%252527localhost%252527%2525252C%252525208080%2525252C%25252520demo_app%252529%2525250A%25252520%25252520%25252520%25252520redirect_uri%25252520%2525253D%25252520f%252527http%2525253A%2525252F%2525252Flocalhost%2525253A%2525257Bserver.server_port%2525257D%2525252F%252527%2525250A%25252520%25252520%25252520%25252520auth_url%25252520%2525253D%25252520f%252527https%2525253A%2525252F%2525252Fgetpocket.com%2525252Fauth%2525252Fauthorize%2525253Frequest_token%2525253D%2525257Brequest_token%2525257D%25252526redirect_uri%2525253D%2525257Bredirect_uri%2525257D%252527%2525250A%2525250A%25252520%25252520%25252520%25252520webbrowser.open%252528auth_url%2525252C%25252520new%2525253D1%2525252C%25252520autoraise%2525253DTrue%252529%2525250A%2525250A%25252520%25252520%25252520%25252520server.handle_request%252528%252529%2525250A%25252520%25252520%25252520%25252520server.server_close%252528%252529&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6f7e34248b1edd8b7b5535ff4cca607/href">https://medium.com/media/a6f7e34248b1edd8b7b5535ff4cca607/href</a></iframe><p>With that out of the way we can get our access token by sending a POST request with the consumer key and the request key in the header.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%252520get_access_token%2528consumer_key%25253A%252520str%25252C%252520request_token%25253A%252520str%2529%252520-%25253E%252520str%25253A%25250A%252520%252520%252520%252520url%252520%25253D%252520%2527https%25253A%25252F%25252Fgetpocket.com%25252Fv3%25252Foauth%25252Fauthorize%2527%25250A%25250A%252520%252520%252520%252520res%252520%25253D%252520requests.post%2528url%25252C%252520data%25253D%25257B%2527consumer_key%2527%25253A%252520consumer_key%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%2527code%2527%25253A%252520request_token%25257D%2529%25250A%25250A%252520%252520%252520%252520if%252520res.status_code%252520%25253D%25253D%252520200%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520access_token_text%25252C%252520username_text%252520%25253D%252520res.text.split%2528%2527%252526%2527%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520access_token%252520%25253D%252520access_token_text.split%2528%2527%25253D%2527%2529%25255B1%25255D%25250A%25250A%252520%252520%252520%252520%252520%252520%252520%252520return%252520access_token%25250A%252520%252520%252520%252520else%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520raise%252520Exception%2528f%252522Request%252520unsuccessful.%252520Reason%25253A%252520%25257Bres.headers%25255B%2527X-Error%2527%25255D%25257D%252522%2529&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%25252520get_access_token%252528consumer_key%2525253A%25252520str%2525252C%25252520request_token%2525253A%25252520str%252529%25252520-%2525253E%25252520str%2525253A%2525250A%25252520%25252520%25252520%25252520url%25252520%2525253D%25252520%252527https%2525253A%2525252F%2525252Fgetpocket.com%2525252Fv3%2525252Foauth%2525252Fauthorize%252527%2525250A%2525250A%25252520%25252520%25252520%25252520res%25252520%2525253D%25252520requests.post%252528url%2525252C%25252520data%2525253D%2525257B%252527consumer_key%252527%2525253A%25252520consumer_key%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%252527code%252527%2525253A%25252520request_token%2525257D%252529%2525250A%2525250A%25252520%25252520%25252520%25252520if%25252520res.status_code%25252520%2525253D%2525253D%25252520200%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520access_token_text%2525252C%25252520username_text%25252520%2525253D%25252520res.text.split%252528%252527%25252526%252527%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520access_token%25252520%2525253D%25252520access_token_text.split%252528%252527%2525253D%252527%252529%2525255B1%2525255D%2525250A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%25252520access_token%2525250A%25252520%25252520%25252520%25252520else%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520raise%25252520Exception%252528f%25252522Request%25252520unsuccessful.%25252520Reason%2525253A%25252520%2525257Bres.headers%2525255B%252527X-Error%252527%2525255D%2525257D%25252522%252529&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/30212ab7f074ac8029344b4ef96bf250/href">https://medium.com/media/30212ab7f074ac8029344b4ef96bf250/href</a></iframe><p>To make the process a little bit cleaner, let’s create a function that will run the entire process for us.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%252520authenticate_app%2528%2529%252520-%25253E%252520str%25253A%25250A%252520%252520%252520%252520request_token%252520%25253D%252520get_request_token%2528CONSUMER_KEY%2529%25250A%252520%252520%252520%252520authorize_request_token%2528request_token%2529%25250A%252520%252520%252520%252520access_token%252520%25253D%252520get_access_token%2528CONSUMER_KEY%25252C%252520request_token%2529%25250A%25250A%252520%252520%252520%252520return%252520access_token&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%25252520authenticate_app%252528%252529%25252520-%2525253E%25252520str%2525253A%2525250A%25252520%25252520%25252520%25252520request_token%25252520%2525253D%25252520get_request_token%252528CONSUMER_KEY%252529%2525250A%25252520%25252520%25252520%25252520authorize_request_token%252528request_token%252529%2525250A%25252520%25252520%25252520%25252520access_token%25252520%2525253D%25252520get_access_token%252528CONSUMER_KEY%2525252C%25252520request_token%252529%2525250A%2525250A%25252520%25252520%25252520%25252520return%25252520access_token&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/327b04b3f31e787f695b61862bab6274/href">https://medium.com/media/327b04b3f31e787f695b61862bab6274/href</a></iframe><h4>Get saved articles</h4><p>Now that we dealt with the authorization part, let’s dive into the more interesting part: getting the list of saved articles and searching our word.</p><p>And how do we do that? Yeah, you guessed it, a POST request.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%252520requests%25250A%25250A%25250Aurl%252520%25253D%252520%2527https%25253A%25252F%25252Fgetpocket.com%25252Fv3%25252Fget%2527%25250A%25250Ares%252520%25253D%252520requests.post%2528url%25252C%252520data%25253D%25257B%2527consumer_key%2527%25253A%252520consumer_key%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%2527access_token%2527%25253A%252520access_token%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%2527state%2527%25253A%252520%2527all%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%2527detailType%2527%25253A%252520%2527simple%2527%25257D%2529.json%2528%2529&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dimport%25252520requests%2525250A%2525250A%2525250Aurl%25252520%2525253D%25252520%252527https%2525253A%2525252F%2525252Fgetpocket.com%2525252Fv3%2525252Fget%252527%2525250A%2525250Ares%25252520%2525253D%25252520requests.post%252528url%2525252C%25252520data%2525253D%2525257B%252527consumer_key%252527%2525253A%25252520consumer_key%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%252527access_token%252527%2525253A%25252520access_token%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%252527state%252527%2525253A%25252520%252527all%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%252527detailType%252527%2525253A%25252520%252527simple%252527%2525257D%252529.json%252528%252529&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6fd5b51cd27591dfa8baf330155fd9f/href">https://medium.com/media/f6fd5b51cd27591dfa8baf330155fd9f/href</a></iframe><p>The list of items we are after is under <em>“list”</em>, so we can iterate over the items and extract the url, which are under the name of <em>given_url</em>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dsaved_items%252520%25253D%252520res%25255B%2527list%2527%25255D%25250A%25250Asaved_urls%252520%25253D%252520%25255Bsaved_items%25255Bitem%25255D%25255B%2527given_url%2527%25255D%252520for%252520item%252520in%252520saved_items%25255D&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dsaved_items%25252520%2525253D%25252520res%2525255B%252527list%252527%2525255D%2525250A%2525250Asaved_urls%25252520%2525253D%25252520%2525255Bsaved_items%2525255Bitem%2525255D%2525255B%252527given_url%252527%2525255D%25252520for%25252520item%25252520in%25252520saved_items%2525255D&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ca4cc68192de44bbd7c5c3d605f9aa9/href">https://medium.com/media/3ca4cc68192de44bbd7c5c3d605f9aa9/href</a></iframe><h3>Find word in the list of URLs</h3><p>Now that we have a list of URLs, we need to fetch their content and search for our word.</p><h4>Get URL content</h4><p>For this project, we can get make a GET request with the URL and get the content of the website from the response. And to make sure that our app does not crash as a result of a bad website (maybe it’s not available anymore), let’s add a little bit of error handling in our code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C184%252C195%252C0%2529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%252520get_url_html_content%2528url%25253A%252520str%2529%252520-%25253E%252520str%25253A%25250A%252520%252520%252520%252520try%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520res%252520%25253D%252520requests.get%2528url%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520if%252520res.status_code%252520%25253D%25253D%252520200%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520return%252520res.text%25250A%252520%252520%252520%252520%252520%252520%252520%252520else%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520return%252520%2527%2527%25250A%252520%252520%252520%252520except%252520Exception%252520as%252520e%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520print%2528f%2527Could%252520not%252520connect%252520to%252520%25257Burl%25257D.%2527%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520pass&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C184%25252C195%25252C0%252529%26t%3Dseti%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Ddef%25252520get_url_html_content%252528url%2525253A%25252520str%252529%25252520-%2525253E%25252520str%2525253A%2525250A%25252520%25252520%25252520%25252520try%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520res%25252520%2525253D%25252520requests.get%252528url%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520if%25252520res.status_code%25252520%2525253D%2525253D%25252520200%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%25252520res.text%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520else%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%25252520%252527%252527%2525250A%25252520%25252520%25252520%25252520except%25252520Exception%25252520as%25252520e%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520print%252528f%252527Could%25252520not%25252520connect%25252520to%25252520%2525257Burl%2525257D.%252527%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520pass&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4bd7e114a7d770bc627e6f38030fdfa/href">https://medium.com/media/a4bd7e114a7d770bc627e6f38030fdfa/href</a></iframe><h4>Does it contain my word?</h4><p>As we are handling the website content as a string, we can use Python’s string method <em>find</em> to check if the website contains our word. Let’s also add some error handling here and make sure that our code searches for lower and capitalized versions of the word.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FjcTYLIHLJmtnC3ScF3Pp%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FjcTYLIHLJmtnC3ScF3Pp&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fapi%2Fimage%2FjcTYLIHLJmtnC3ScF3Pp&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d347f620e6b4e3ba6b210c2ae275a87/href">https://medium.com/media/8d347f620e6b4e3ba6b210c2ae275a87/href</a></iframe><h4>Running it all together</h4><p>Now we can create a function that runs both the extraction of the content and checks if it contains the word for each URL in our list of URLs.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FNlk8yZZeIyWxvpvmnWZN%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FNlk8yZZeIyWxvpvmnWZN&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d84cbcde352f5f55b47dac409049a0b/href">https://medium.com/media/2d84cbcde352f5f55b47dac409049a0b/href</a></iframe><h3>Wrapping everything in a callable file</h3><p>Cool, so now that we created functions to authorize our application, gather the list of saved URLs, and search for a word in the content of each URL, let’s put everything together in a simple function that will:</p><ol><li>ask the user which word we need to look for</li><li>authenticate the application</li><li>make the search</li><li>return the list of URLs that contain the chosen word</li></ol><p>As this is the centerpiece of our little project, I’ll create a <em>main.py</em> in the package’s root and call our function <em>main</em>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%2FNlk8yZZeIyWxvpvmnWZN%3F&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2FNlk8yZZeIyWxvpvmnWZN&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d84cbcde352f5f55b47dac409049a0b/href">https://medium.com/media/2d84cbcde352f5f55b47dac409049a0b/href</a></iframe><p>And we are done! Now we can go ahead and have some fun opening all the URLs that contain the word we remember and enjoy a cup of coffee while we read it (or forget about it again).You can find the entire project <a href="https://github.com/riccardobranz/pocket-finder">in Github</a>.</p><h3>Wait!!! Where is the article?</h3><p>Yeah, about that… I think I may have deleted it in one of my “spring cleanings” or the website is not available anymore. Sad story, but oh well, at least I learned how to do some cool stuff in Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c56d48348cc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[As 3 fórmulas para resolver 80% dos casos [parte 1] — PROCV]]></title>
            <link>https://riccardo-branz.medium.com/as-3-f%C3%B3rmulas-para-resolver-80-dos-casos-parte-1-e11f52347e54?source=rss-a7cb58df1fc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e11f52347e54</guid>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Riccardo Branz]]></dc:creator>
            <pubDate>Wed, 21 Jun 2017 21:41:54 GMT</pubDate>
            <atom:updated>2017-06-26T10:54:13.573Z</atom:updated>
            <content:encoded><![CDATA[<p>Em 1897 Vilfredo Pareto estudou a distribuição de riquezas na Itália através da propriedade de terras, encontrando que a riqueza não era distribuída uniformemente. No estudo ele encontrou que cerca de 80% da riqueza estava nas mãos de cerca de 20% da população.</p><p>Em sua homenagem, foi nomeado o <a href="https://pt.wikipedia.org/wiki/Princ%C3%ADpio_de_Pareto">Princípio de Pareto</a> que afirma que 80% dos efeitos provém de 20% das causas. Este princípio é usado atualmente em muitas áreas e, de certa forma, se aplica também ao Excel.</p><p><strong>Pela minha experiência, a maioria dos problemas no Excel podem ser resolvidos usando 3 fórmulas: PROCV, SOMASE, CONT.SE.</strong></p><p>Dessas três fórmulas, o PROCV é definitivamente o que mais intriga as pessoas. Neste post irei explicar como ele funciona e acabar de vez com o mito que o cerca.</p><blockquote>PROCV(valor_procurado; matriz_tabela; núm_indice_coluna; [procurar intervalo])</blockquote><p>O ProcV e o ProcH funcionam da mesma maneira, eles procuram um valor em uma tabela (matriz) e retornam um outro valor relacionado da mesma tabela quando o encontrar. Para melhor entender este conceito, imagine uma tabela com as informações de clientes conforme a imagem abaixo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*NeT2hGAjckRe6UDBviZlxQ.png" /></figure><p>Digamos que em outra tabela queremos preencher o estado para onde devemos enviar as encomendas dos clientes que fizeram compras conosco.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*AIkZRSJIYMpVjTiL4NCQ-g.png" /></figure><p>Temos três opções:</p><ol><li>copiar a coluna dos estados da primeira tabela e colar na segunda, mas os nomes não estão na mesma ordem então nosso relatório ficaria com informações erradas;</li><li>procurar um a um dos valores e digitamos na nova tabela, o que pode não ser um trabalho muito extenso caso tenhamos poucos clientes, mas se tivermos muitas linhas a preencher esse trabalho fica muito extenso e o Excel está aqui para facilitar a nossa vida.</li><li>usar o ProcV para que ele nos retorne os valores que queremos encontrar.</li></ol><p>Vamos então entender cada campo da função PROCV.</p><ul><li>valor_procurado : este é o valor que a função irá procurar na outra tabela. No nosso caso este é o nome do cliente, pois é o que conecta uma tabela à outra.</li><li>matriz_tabela : é a tabela onde a função irá procurar o valor_procurado, lembrando que este deve estar na primeira coluna. Neste caso a nossa matriz_tabela é a tabela A1:D6.</li><li>núm_indice_coluna : é como diremos qual valor queremos que a função encontre pra gente. Para descobrir isso basta contar as colunas em que se encontra o valor que queremos. Em nosso caso é a quarta coluna.</li><li>[procurar intervalo] : na maioria dos casos este campo será sempre FALSO, em um post futuro irei discutir para que serve a variante VERDADEIRO.</li></ul><p>No final nossa fórmula ficará assim:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FE4CC3heHiDjolo8M3xHLg.gif" /></figure><p>Espero ter conseguido esclarecer esta fórmula para vocês, caso ainda tenham alguma dúvida me digam que complemento a explicação em outro post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e11f52347e54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vamos conversar sobre Excel?]]></title>
            <link>https://riccardo-branz.medium.com/vamos-conversar-sobre-excel-11f27e5d9b28?source=rss-a7cb58df1fc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/11f27e5d9b28</guid>
            <category><![CDATA[basico]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Riccardo Branz]]></dc:creator>
            <pubDate>Tue, 13 Jun 2017 15:46:17 GMT</pubDate>
            <atom:updated>2017-06-13T16:57:15.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjoWhJVj6iuGW9wta_8GlQ.png" /></figure><p>Sim, a primeira vez que você abre o Excel é terrificante. A tal ponto que a maioria das pessoas só o abrem em casos de extrema necessidade, mas eu te garanto que assim que você se acostumar com a sua cara e aprender algumas coisinhas você vai abrir ele pra tudo!</p><p>Para começarmos a conversar sobre o Excel, precisamos passar um pouco do básico. [Caso você já possui experiência com o Excel, fique à vontade de voltar no próximo post ou dar uma lida rápida para revisar.]</p><p>- Nomenclatura das células</p><p>O Excel é composto por Linhas e Colunas, com as células estando na interseção dessas. A forma mais comum de se referenciar uma célula em Excelziano é conforme o seguinte exemplo: A1; ou seja, Coluna A Linha 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*yqCPy52LrJNxysPrN2cptw.png" /></figure><p>- Referenciando células</p><p>Vou utilizar um exemplo para explicar o que é uma referência. Digamos que você queira saber o dobro do valor da célula A1, na sua célula A2 basta colocarmos =A1*2 . O A1 nessa fórmula se esta referenciando, buscando o valor da célula A1 para nós.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*M272Ssz3lpJUgDTMDAZ9tg.gif" /></figure><p>Mas imagina se tivermos que achar o dobro de vários números, seria doideira ficar escrevendo fórmula por fórmula, né? Qual seria a diferença de simplesmente fazer a conta na calculadora? É nessa hora que o Excel começa a brilhar. Observem o quadrado na parte inferior direita da célula, esse quadrado é onde a magia acontece.</p><p>Se arrastarmos esse quadrado, o conteúdo da célula vai ser copiado para as outras células. Caso tenha uma fórmula com referências essas referências vão “caminhar” junto com a célula. Observem a imagem abaixo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*G0O7y1Ol7DICQjOo2H_YDQ.gif" /></figure><p>Magico né? E se eu te disser que existe algo ainda mais mágico, observe o que acontece caso cliquemos duas vezes no quadrado.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*qrJT4pWFRMWJh8EJ6IpZFw.gif" /></figure><p>Agora que aprendemos como chamar as células e a referênciá-las nas fórmulas, podemos aprender as duas teclas mais importantes do seu teclado [enquanto o Excel estiver aberto]: F2 e F4.</p><p><em>- F2</em></p><p>O F2 serve para alterar algo dentro de uma célula, ou seja, se você quiser que [por exemplo] a sua seta da esquerda se mova dentro da fórmula do Excel (imagem A) e não pelas células do Excel (imagem B).</p><p><em>- F4</em></p><p>O F4 é extramente importante quando estamos colocando uma fórmula na célula, porque ela te permite de “travar” uma referência. Calma, isso não é complicado.</p><p>Vamos relembrar do exemplo em que tivemos que achar o dobro de vários números na coluna A. Agora suponhamos que nem sempre vamos querer o dobro do valor da célula, eventualmente podemos querer o valor multiplicado por qualquer outro número. Para isso vamos colocar o multiplicador na célula D5. Na célula B1 inserimos a fórmula =A1*D5, mas ao arrastarmos pra baixo… ERRO! Não é o resultado que queremos.</p><p>Se apertarmos F2 na célula B2 (olha o F2 lindo já aparecendo!) vemos que tanto o A1 quanto o D5 se deslocaram quando arrastamos a célula pra baixo, mas o D5 não devia ter se deslocado. Pra resolvermos isso, vamos “travar” a referência à célula D5 apertando um F4 sobre ela. Resultado: $D$5</p><p>Calma, não desandou tudo. Vamos ver como funcionam as travas. A trava serve para que a célula não “ande” quando arrastarmos uma célula, ou seja, ele trava a referência àquela célula. Utilizando nosso glorioso A1, vamos ver as quatro opções de trava disponíveis:<br> — A1 | Nenhuma trava<br> — $A$1 | Tudo travado, nem a coluna nem a linha vão se mexer<br> — A$1 | Só a linha travada<br> — $A1 | Só a coluna travada</p><p>Essas duas teclas são essenciais no dia-a-dia com o Excel, como vocês poderão observar nos próximos posts.</p><p>Deixem nos comentários suas perguntas e sugestões do que você gostaria de ler aqui no blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11f27e5d9b28" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>