<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hansana Ranaweera</title>
    <description>The latest articles on DEV Community by Hansana Ranaweera (@ranahp).</description>
    <link>https://dev.to/ranahp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F498333%2F14e2bdc1-b028-414b-b861-a795cdf5ca3b.JPG</url>
      <title>DEV Community: Hansana Ranaweera</title>
      <link>https://dev.to/ranahp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ranahp"/>
    <language>en</language>
    <item>
      <title>Automate Facebook APIs with Python ( Publish a Post on Facebook using Python )</title>
      <dc:creator>Hansana Ranaweera</dc:creator>
      <pubDate>Thu, 21 Apr 2022 11:49:47 +0000</pubDate>
      <link>https://dev.to/ranahp/automate-facebook-apis-with-python-publish-a-post-on-facebook-using-python--4d91</link>
      <guid>https://dev.to/ranahp/automate-facebook-apis-with-python-publish-a-post-on-facebook-using-python--4d91</guid>
      <description>&lt;p&gt;Here we are going to discuss how to publish a post on Facebook with Facebook graph API using python&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First We are Going to Getting Know about What is Facebook Graph APIs&lt;/strong&gt;&lt;br&gt;
The Facebook Graph API exposes URL endpoints to which you can make GET and POST calls to interact with your Facebook page or upload data and posts to your Facebook account. The Graph API is the primary way for apps to read and write to the Facebook social graph.&lt;br&gt;
using Facebook Graph API,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the messages on your timeline,&lt;/li&gt;
&lt;li&gt;Send messages,&lt;/li&gt;
&lt;li&gt;Read posts,&lt;/li&gt;
&lt;li&gt;Create posts, edit posts or even delete posts and etc…&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Before You Start, You will need ( see video tutorial ):&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register as a &lt;a href="https://developers.facebook.com/docs/development/register" rel="noopener noreferrer"&gt;Facebook Developers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a &lt;a href="https://developers.facebook.com/apps/?show_reminder=true" rel="noopener noreferrer"&gt;Facebook App&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open the &lt;a href="https://developers.facebook.com/tools/explorer/" rel="noopener noreferrer"&gt;Graph Explorer tool&lt;/a&gt; ( this tool lets you make calls to Facebook’s Graph API)&lt;/li&gt;
&lt;li&gt;Get brief understanding of the structure of the Facebook Social Graph from our&lt;a href="https://developers.facebook.com/docs/graph-api/overview#nodes" rel="noopener noreferrer"&gt; Graph API Overview&lt;/a&gt; guide&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;** Main Step 01 **( Create a Facebook App )&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8p14f5vmr4yyl8zmk68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8p14f5vmr4yyl8zmk68.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
 &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2f9o0g8tc2zp6f170yw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2f9o0g8tc2zp6f170yw.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
 &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkf3p1l5kjuvs3p1lrse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkf3p1l5kjuvs3p1lrse.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** &lt;a href="https://vimeo.com/701609024" rel="noopener noreferrer"&gt;Main Step 02&lt;/a&gt; ** ( Get your Facebook Page Access Tokens )&lt;br&gt;
see this video &lt;a href="https://vimeo.com/701609024" rel="noopener noreferrer"&gt;https://vimeo.com/701609024&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxex41d6msvrjifukqecu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxex41d6msvrjifukqecu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** Main Step 03 ** ( Send Request Using Python )&lt;/p&gt;

&lt;p&gt;We will be using the requests library for sending the HTTP requests. Requests allow you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs or to form-encode your PUT &amp;amp; POST data — but nowadays, just use the json method!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

python -m pip install requests


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;You will also need a page ID — for the Facebook page you would like to post to. You can get your page ID directly from your Facebook page, under the “About” tab. Copy this ID and paste it into your code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbzee85fc74avgobuzu0i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbzee85fc74avgobuzu0i.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;This is the code for creating a post&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import requests
#Your Access Keys
page_id_1 = 123456789
# Your Page Access Token
facebook_access_token_1 = ‘Your Page Access Token’
# Post Content as Text
msg = ‘hi buddy’
post_url = ‘https://graph.facebook.com/{}/feed'.format(page_id_1)
payload = {
‘message’: msg,
‘access_token’: facebook_access_token_1
}
r = requests.post(post_url, data=payload)
print(r.text)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>CyboShool against Education Problem that comes with COVID 19 Pandemic</title>
      <dc:creator>Hansana Ranaweera</dc:creator>
      <pubDate>Mon, 26 Oct 2020 15:27:26 +0000</pubDate>
      <link>https://dev.to/ranahp/cyboshool-5hko</link>
      <guid>https://dev.to/ranahp/cyboshool-5hko</guid>
      <description>&lt;h2&gt;
  
  
  Team Declaration
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Team Name - Bits N' Bytes
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Student ID Number&lt;/th&gt;
&lt;th&gt;Github Handle&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Team Leader&lt;/td&gt;
&lt;td&gt;Hansana Prabavith Ranaweera&lt;/td&gt;
&lt;td&gt;2019CS135&lt;/td&gt;
&lt;td&gt;&lt;a class="mentioned-user" href="https://dev.to/ranahp"&gt;@ranahp&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What we are building
&lt;/h2&gt;

&lt;p&gt;This is Virtual Learning Environment for kids. Actually, this is more than a normal Virtual Learning Management System because we created an AI-powered 3D character to Interact with the kid. And  3D character can predict the kid's facial expression using Machine-Learning. So According to the kid's facial expression, we decide what we are going to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we built it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;[Initial Update]&lt;/strong&gt;&lt;br&gt;
Initially, I had to consider the current situation in Sri Lankan to get an idea about what I going to build. So I found a very serious problem that every teacher who teaches to grade 1-5 students and also a student and their parents had. That is not efficient in online learning because It is difficult to stay students who are studying grade 1-5  with computer and Online meeting. Actually, they are kids so they would like to play some games, dance, sing, and they usually unable to concentrate their minds on online studies. So Parents should have to stay with them during the online meeting or online study times. You know It is not possible. To that problem, I decide to make a VIRTUAL LEARNING MANAGEMENT SYSTEM with AI POWERD 3D Character &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Update 3]&lt;/strong&gt;&lt;br&gt;
I made a basic prototype with character and characters animation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Update 4]&lt;/strong&gt;&lt;br&gt;
Then I add Machine Learning to Detect facial expression and get what the student current facial expression&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Update 5]&lt;/strong&gt;&lt;br&gt;
after I worked with Text to Speech API. and add to prototype&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Final Update]&lt;/strong&gt;&lt;br&gt;
Finally, I assemble the whole prat together and wrote Main Algorithm to work all part correctly and work randomly and also add some style according to neon colors&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Hacktoberfest actually this is one of the best hackathons because I learned a lot of new stuff and I studied how I manage my project and interact with friends and seniors. I learned how to work with 3d characters, how to animate them and learn some machine learning to predict facial expression and a lot of things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo Link
&lt;/h2&gt;

&lt;p&gt;Demo Link: -------- (Optional)&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;

&lt;p&gt;&lt;u&gt;Github&lt;/u&gt; &lt;br&gt;
Frontend: &lt;a href="https://github.com/ranaHP/CyboSchool"&gt;https://github.com/ranaHP/CyboSchool&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ucsc2020</category>
    </item>
  </channel>
</rss>
