<?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: Mr.Morsalin</title>
    <description>The latest articles on DEV Community by Mr.Morsalin (@mrmorsalin1).</description>
    <link>https://dev.to/mrmorsalin1</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%2F561938%2F3a98d3cc-475e-4b23-bafa-ada567d2cd84.jpg</url>
      <title>DEV Community: Mr.Morsalin</title>
      <link>https://dev.to/mrmorsalin1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrmorsalin1"/>
    <language>en</language>
    <item>
      <title>PYthon-InstagramBoot_auto_like</title>
      <dc:creator>Mr.Morsalin</dc:creator>
      <pubDate>Thu, 04 Mar 2021 14:31:05 +0000</pubDate>
      <link>https://dev.to/mrmorsalin1/python-instagrambootautolike-h52</link>
      <guid>https://dev.to/mrmorsalin1/python-instagrambootautolike-h52</guid>
      <description>&lt;h1&gt;
  
  
  require
&lt;/h1&gt;

&lt;h3&gt;
  
  
  geckodriver.exe //for firefox
&lt;/h3&gt;

&lt;h3&gt;
  
  
  chomiume driver.exe // for chrome
&lt;/h3&gt;

&lt;h3&gt;
  
  
  python already installed
&lt;/h3&gt;

&lt;h3&gt;
  
  
  well-done use and enjoy
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/pip-pipo/PYthon-InstagramBoot_auto_like.git"&gt;for git-hub full code&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import random
import sys


def print_same_line(text):
    sys.stdout.write('\r')
    sys.stdout.flush()
    sys.stdout.write(text)
    sys.stdout.flush()


class InstagramBot:

    def __init__(self, username, password):
        self.username = username
        self.password = password
        self.driver = webdriver.Firefox()

    def closeBrowser(self):
        self.driver.close()

    def login(self):
        driver = self.driver
        driver.get("https://www.instagram.com/")
        time.sleep(3)
        user_name = driver.find_element_by_xpath("//input[@name='username']")
        user_name.clear()
        user_name.send_keys(self.username)
        password = driver.find_element_by_xpath("//input[@name='password']")
        password.clear()
        password.send_keys(self.password)
        password.send_keys(Keys.RETURN)
        time.sleep(3)

    def like_photo(self, hashtag):
        driver = self.driver
        driver.get("https://www.instagram.com/explore/tags/" + hashtag + "/")
        time.sleep(2)

        # gathering photos
        pic_hrefs = []
        for i in range(1, 7):
            try:
                driver.execute_script(
                    "window.scrollTo(0, document.body.scrollHeight);")
                time.sleep(2)
                # get tags
                hrefs_in_view = driver.find_elements_by_tag_name('a')
                # finding relevant hrefs
                hrefs_in_view = [elem.get_attribute('href') for elem in hrefs_in_view
                                 if '.com/p/' in elem.get_attribute('href')]
                # building list of unique photos
                [pic_hrefs.append(href)
                 for href in hrefs_in_view if href not in pic_hrefs]
                # print("Check: pic href length " + str(len(pic_hrefs)))
            except Exception:
                continue

        # Liking photos
        unique_photos = len(pic_hrefs)
        for pic_href in pic_hrefs:
            driver.get(pic_href)
            time.sleep(2)
            driver.execute_script(
                "window.scrollTo(0, document.body.scrollHeight);")
            try:
                time.sleep(random.randint(2, 4))

                def like_button(): return driver.find_element_by_xpath(
                    '//span[@aria-label="Like"]').click()
                like_button().click()
                for second in reversed(range(0, random.randint(18, 28))):
                    print_same_line("#" + hashtag + ': unique photos left: ' + str(unique_photos)
                                    + " | Sleeping " + str(second))
                    time.sleep(1)
            except Exception as e:
                time.sleep(2)
            unique_photos -= 1


if __name__ == "__main__":

    username = "your username" //your username must be here
    password = "your password" // your password must be here

    ig = InstagramBot(username, password)
    ig.login()

    hashtags = ['amazing', 'beautiful', 'adventure', 'photography', 'nofilter',
                'newyork', 'artsy', 'alumni', 'lion', 'best', 'fun', 'happy',
                'art', 'funny', 'me', 'followme', 'follow', 'cinematography', 'cinema',
                'love', 'instagood', 'instagood', 'followme', 'fashion', 'sun', 'scruffy',
                'street', 'canon', 'beauty', 'studio', 'pretty', 'vintage', 'fierce']

    while True:
        try:
            # Choose a random tag from the list of tags
            tag = random.choice(hashtags)
            ig.like_photo(tag)
        except Exception:
            ig.closeBrowser()
            time.sleep(60)
            ig = InstagramBot(username,password)
            ig.login()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  don't forget to give a love thanks
&lt;/h4&gt;

</description>
      <category>python</category>
      <category>seleniume</category>
    </item>
    <item>
      <title>Simple-Logic-Behind-Jquery</title>
      <dc:creator>Mr.Morsalin</dc:creator>
      <pubDate>Thu, 04 Mar 2021 14:23:04 +0000</pubDate>
      <link>https://dev.to/mrmorsalin1/simple-logic-behind-jquery-328o</link>
      <guid>https://dev.to/mrmorsalin1/simple-logic-behind-jquery-328o</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// make  function with make($)
const $ = (d) =&amp;gt; {
// make object
  const self = {
      element:document.querySelector(d),
      html:()=&amp;gt; self.element,
      hide:()=&amp;gt; self.element.style.display="none",
      show:()=&amp;gt; self.element.style.display="",
      click:(event,callback)=&amp;gt;self.element.addEventListener(event,callback),
  };
// return object
  return self
};

// final result
$('body').click('click',()=&amp;gt;console.log('click'))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>jquery</category>
    </item>
    <item>
      <title>Google popup sign in with react and firebase</title>
      <dc:creator>Mr.Morsalin</dc:creator>
      <pubDate>Sat, 30 Jan 2021 11:48:01 +0000</pubDate>
      <link>https://dev.to/mrmorsalin1/google-popup-sign-in-with-react-and-firebase-2oh1</link>
      <guid>https://dev.to/mrmorsalin1/google-popup-sign-in-with-react-and-firebase-2oh1</guid>
      <description>&lt;h1&gt;
  
  
  set up firebase config:
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var firebaseConfig = {
    apiKey: "super secret keys.....asgvegxgevergfvr",
    authDomain: "tallans-imageupload-tutorial.firebaseapp.com",
    databaseURL: "https://tallans-imageupload-tutorial.firebaseio.com",
    projectId: "tallans-imageupload-tutorial",
    storageBucket: "tallans-imageupload-tutorial.appspot.com",
    messagingSenderId: "super secret keys.....asgvegxgevergfvr",
    appId: "super secret app id....adsfa;lsdkjf",
    measurementId: "super secret as;dlkfjal;dskjf"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
  firebase.analytics();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  then ::
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make npx-create-react-app client
and ::
npm i or yarn add firebase 
and react-router-dom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now::&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd client 
cd src
mkdir componets/login.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  App.js::
&lt;/h1&gt;

&lt;p&gt;==========&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
import './App.css'
import Login from './components/Login'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
import Logout from './components/Logout'
import Welcome from './components/Welcome'
const App = () =&amp;gt; {
  return (
    &amp;lt;div&amp;gt;

      &amp;lt;Router&amp;gt;
        &amp;lt;Switch&amp;gt;
          &amp;lt;Route exact path="/" component={Login} /&amp;gt;
          &amp;lt;Route exact path="/home" component={Logout} /&amp;gt;
          &amp;lt;Route exact path="/welcome" component={Welcome} /&amp;gt;

        &amp;lt;/Switch&amp;gt;
      &amp;lt;/Router&amp;gt;

    &amp;lt;/div&amp;gt;
  )
}

export default App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  login.js::
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
import firebase from '../services/firebase'
import {useHistory} from 'react-router-dom'
import './Login.css'
const Login = () =&amp;gt; {
const history = useHistory();
    const signInWithGoogle = () =&amp;gt; {
        const provider = new firebase.auth.GoogleAuthProvider();
        firebase.auth().signInWithPopup(provider)
            .then((success) =&amp;gt; {

                let user = success.user;

                const obj = {
                    username : user.displayName,
                    email:user.email,
                    uid:user.uid,
                    img:user.photoURL
                }
                console.log(obj)
                localStorage.setItem('codecaamp',JSON.stringify(obj))
                history.push('/welcome')
            })
            .catch(err =&amp;gt; err.message)
    }

    return (
        &amp;lt;div className="login-buttons"&amp;gt;
            &amp;lt;div  className="ikmg"&amp;gt;&amp;lt;img width="200px" src="https://res.cloudinary.com/codecaamp/image/upload/v1610815107/Purple_Modern_Technology_Gaming_Logo_gqpbv2.png" alt="codecaamp"/&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;h2 style={{fontFamily:"monospace",fontSize:"40px"}}&amp;gt;Welcome to Codecaamp&amp;lt;/h2&amp;gt;
            &amp;lt;h3&amp;gt;Continue With&amp;lt;/h3&amp;gt;
            &amp;lt;button className="login-provider-button" onClick={signInWithGoogle}&amp;gt;
                &amp;lt;img src="https://img.icons8.com/ios-filled/50/000000/google-logo.png" alt="google icon" /&amp;gt;
                &amp;lt;span&amp;gt; Continue with Google&amp;lt;/span&amp;gt;
            &amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
    )
}

export default Login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>javascript</category>
      <category>firebase</category>
    </item>
    <item>
      <title>style={{whiteSpace:"pre-line"}}</title>
      <dc:creator>Mr.Morsalin</dc:creator>
      <pubDate>Wed, 27 Jan 2021 17:05:45 +0000</pubDate>
      <link>https://dev.to/mrmorsalin1/style-whitespace-pre-line-3gfk</link>
      <guid>https://dev.to/mrmorsalin1/style-whitespace-pre-line-3gfk</guid>
      <description>&lt;p&gt;Querying Nested Arrays&lt;/p&gt;

&lt;p&gt;To work with tree data structure we need to flatten them.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;We will be solving a problem using Array.prototype.forEach().
We will define Array.prototype.concatAll() using Array.prototype.forEach().
We will solve the same problem using Array.prototype.concatAll()

This post is a follow up post of the
– Getting started Functional Programming in JavaScript. I would recommend reading that post first.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Problem&lt;/p&gt;

&lt;p&gt;Flatten the movieLists array into an array of video ids&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Let’s solve with Array.prototype.forEach()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;'use strict';&lt;/p&gt;

&lt;p&gt;function queryNestedArray() {&lt;br&gt;
  var movieLists = [{&lt;br&gt;
      name: "New Releases",&lt;br&gt;
      videos: [{&lt;br&gt;
        "id": 70111470,&lt;br&gt;
        "title": "Die Hard",&lt;br&gt;
        "rating": 4.0&lt;br&gt;
      }, {&lt;br&gt;
        "id": 654356453,&lt;br&gt;
        "title": "Bad Boys",&lt;br&gt;
        "rating": 5.0&lt;br&gt;
      }]&lt;br&gt;
    }, {&lt;br&gt;
      name: "Dramas",&lt;br&gt;
      videos: [{&lt;br&gt;
        "id": 65432445,&lt;br&gt;
        "title": "The Chamber",&lt;br&gt;
        "rating": 4.0&lt;br&gt;
      }, {&lt;br&gt;
        "id": 675465,&lt;br&gt;
        "title": "Fracture",&lt;br&gt;
        "rating": 5.0&lt;br&gt;
      }]&lt;br&gt;
    }],&lt;br&gt;
    allVideoIdsInMovieLists = [];&lt;/p&gt;

&lt;p&gt;movieLists.forEach(function(movieList) {&lt;br&gt;
    return movieList.videos.forEach(function(video) {&lt;br&gt;
      return allVideoIdsInMovieLists.push(video.id);&lt;br&gt;
    });&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;return allVideoIdsInMovieLists;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;console.log(queryNestedArray()); // [70111470, 654356453, 65432445, 675465]&lt;/p&gt;

</description>
    </item>
    <item>
      <title>i saw it every time i don't know how to fix that I updated that but not work now I reinstall that it's working</title>
      <dc:creator>Mr.Morsalin</dc:creator>
      <pubDate>Mon, 25 Jan 2021 06:05:19 +0000</pubDate>
      <link>https://dev.to/mrmorsalin1/i-saw-it-every-time-i-don-t-know-how-to-fix-that-i-updated-that-but-not-work-now-i-reinstall-that-it-s-working-50g</link>
      <guid>https://dev.to/mrmorsalin1/i-saw-it-every-time-i-don-t-know-how-to-fix-that-i-updated-that-but-not-work-now-i-reinstall-that-it-s-working-50g</guid>
      <description></description>
    </item>
  </channel>
</rss>
