投稿時間:2023-01-03 23:25:35 RSSフィード2023-01-03 23:00 分まとめ(31件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS AWS Compute Blog Serverless ICYMI Q4 2022 https://aws.amazon.com/blogs/compute/serverless-icymi-q4-2022/ Serverless ICYMI Q Welcome to the th edition of the AWS Serverless ICYMI in case you missed it quarterly recap Every quarter we share all the most recent product launches feature enhancements blog posts webinars Twitch live streams and other interesting things that you might have missed In case you missed our last ICYMI check out what happened last … 2023-01-03 13:49:48
python Pythonタグが付けられた新着投稿 - Qiita Pythonのバグ技 —— クラス以外を継承する https://qiita.com/Hanjin_Liu/items/c0d6efc3e5bcc37de1ea classcbanewclassthati 2023-01-03 22:19:37
golang Goタグが付けられた新着投稿 - Qiita 【Golang/gin】いつも使ってるgin.Contextの中身、覗いていきませんか? https://qiita.com/SDTakeuchi/items/7f6314d166580a06d36c gincontext 2023-01-03 22:29:39
Azure Azureタグが付けられた新着投稿 - Qiita Microsoft Azure - API Management Service: 固定のレスポンスを返す https://qiita.com/KenjiOtsuka/items/478226fa27e690cf002c apimanagementservice 2023-01-03 22:47:13
Git Gitタグが付けられた新着投稿 - Qiita DelphiのIDEでバージョン管理(git)の設定方法 https://qiita.com/takahasinaoki/items/13a04aae441d2aaedb1a webusersnoreplygithubcom 2023-01-03 22:26:24
海外TECH DEV Community Instagram Graph API Explained: How to log in users https://dev.to/superface/instagram-graph-api-explained-how-to-log-in-users-lp8 Instagram Graph API Explained How to log in usersThere are two ways how to access the Instagram API Through Instagram s Basic Display APIThrough Instagram Graph APIInstagram Basic Display API is limited to read only access to a user s profile and isn t intended for user authentication It s useful for example to get up to date information about the user s profile or display their recent posts It also works with any Instagram account type personal and professional On the other hand Instagram Graph API allows you to publish posts moderate comments search hashtags and access insights However the Graph API can be used only by “professional accounts which have been paired with a Facebook page The authentication flow is handled through Facebook Login and the user can pick which Facebook pages and Instagram accounts are available to the application This article is part of a series about Instagram Graph API Previously I covered test account and app setup and finding the correct Instagram account ID In this part I will show you how to implement the authentication flow for Instagram Graph API with Facebook Login I will use Node js Express and Passport with the passport facebook strategy but the basic ideas are applicable to any language and framework Facebook Login SetupThis tutorial assumes you have a Facebook application set up and an Instagram business account paired with a Facebook page for testing If not check my previous tutorial We will need to set up Facebook Login for our testing application Find your application on the Facebook Developer Portal and on the Dashboard set up Facebook Login for Business If you didn t select a “Business app type when creating the application you may see Facebook Login instead so choose that both options will work Under Facebook Login Settings make sure to enable both Client OAuth login and Web OAuth login This screen is also where you can add allowed redirect URIs for deployed application We will run the application only locally and Facebook allows localhost URLs by default so there s no need to add any URL Finally visit application Settings gt Basic and copy the App ID and App Secret We will need them for the Passport strategy Instagram Graph API authentication flow with PassportWith Facebook Login now set up we can build an authentication flow I will use the following npm packages express serverexpress session to handle user data persistencepassport for authenticationpassport facebook for handling Facebook Login flowdotenv to read secrets from env file superfaceai one sdk to get the list of accessible Instagram profilesLet s set up the project and install the dependencies mkdir instagram facebook login passportcd instagram facebook login passportnpm install express express session passport passport facebook dotenv superfaceai one sdkNow create a env file and paste in the App ID and App Secret values you obtained in Facebook app settings BASE URL http localhost FACEBOOK CLIENT ID App ID from Settings FACEBOOK CLIENT SECRET App Secret from Settings I have also prepared the BASE URL variable since we will be passing the callback URL during the authentication process Keeping this value configurable makes it easier to take your app to production And now let s create a server js file with the following content const express require express const session require express session const passport require passport const Strategy require passport facebook const SuperfaceClient require superfaceai one sdk require dotenv config const sdk new SuperfaceClient lt gt Serialization and deserializationpassport serializeUser function user done done null user passport deserializeUser function obj done done null obj Use the Facebook strategy within Passportpassport use lt gt Strategy initialization new Strategy clientID process env FACEBOOK CLIENT ID clientSecret process env FACEBOOK CLIENT SECRET callbackURL process env BASE URL auth facebook callback lt gt Verify callback accessToken refreshToken profile done gt console log Success accessToken profile return done null profile accessToken const app express lt gt Session middleware initializationapp use session secret keyboard cat resave false saveUninitialized true app use passport initialize lt gt Start authentication flowapp get auth facebook passport authenticate facebook lt gt Scopes scope pages show list instagram basic instagram content publish lt gt Callback handlerapp get auth facebook callback passport authenticate facebook async function req res next try lt gt Obtaining profiles const accessToken req user accessToken const sdkProfile await sdk getProfile social media publishing profiles const result await sdkProfile getUseCase GetProfilesForPublishing perform provider instagram parameters accessToken const profiles result unwrap res send lt h gt Authentication succeeded lt h gt lt h gt User data lt h gt lt pre gt JSON stringify req user undefined lt pre gt lt h gt Instagram profiles lt h gt lt pre gt JSON stringify profiles undefined lt pre gt next catch err next err app listen gt console log Listening on process env BASE URL Run the server with npm start and visit http localhost auth facebook You will be redirected to the Facebook login where you select the Facebook pages and Instagram profiles the application can have access to Make sure to select the correct Facebook page with the associated Instagram profile Otherwise you won t be able to access that profile After passing the flow you should see the basic data about your profile and a list of Instagram profiles you have access to Explaining the example codeIf you read my tutorial on Twitter OAuth authentication the example will seem very familiar The most significant difference is the handling of access tokens and additional logic for obtaining Instagram profiles I will explain the example in individual parts User serialization and deserialization lt gt Serialization and deserializationpassport serializeUser function user done done null user passport deserializeUser function obj done done null obj These functions serialize and deserialize the user to and from a session In our example application we keep all sessions in memory with no permanent storage so we just pass the whole user object Typically you will persist the data in a database In that case you will store the user ID in the session and upon deserialization find the user in your database using the serialized ID for example passport serializeUser function user done done null user id passport deserializeUser function id done User findOrCreate id then user gt done null user The deserialized user object is then accessible through the req user property in middleware functions You can find more in the Passport documentation on sessions Strategy initialization Use the Facebook strategy within Passportpassport use lt gt Strategy initialization new Strategy clientID process env FACEBOOK CLIENT ID clientSecret process env FACEBOOK CLIENT SECRET callbackURL process env BASE URL auth facebook callback This code registers the passport facebook strategy with credentials obtained from the application settings The callback URL must be absolute and registered as a valid OAuth redirect URL except for localhost Success callbackpassport use new Strategy lt gt Verify callback accessToken refreshToken profile done gt console log Success accessToken profile return done null profile accessToken The second argument to the strategy constructor is a verify function which is called at the end of the successful authorization flow The user has authorized your application and you will receive their access token and basic information about their profile in this case just the ID and full name of the user Facebook API doesn t provide refreshToken you can instead turn the access token into a long lived token therefore that value will be always empty Here you might want to update or create the user in your database and store the access token so that you can access the API on behalf of the user The done callback should receive a user object which is later available through req user To keep things simple I only passed the access token along with the profile data Passport and Session middlewares initialization lt gt Session middleware initializationapp use session secret keyboard cat resave false saveUninitialized true app use passport initialize Passport needs to be initialized as middleware as well And it requires a session middleware for storing state and user data The most common session middleware is express session By default express session stores all data in memory which is good for testing but not intended for production if your server gets restarted all users will be logged out There is a wide selection of compatible session stores  pick one which fits with the rest of your stack Before you put this code into production make sure to change the value of secret This value is used to sign the session cookie Keeping it easily guessable increases the risk of session hijacking Check the express session docs Start the authentication flowNow we are getting to the actual route handlers where the authentication happens lt gt Start authentication flowapp get auth facebook passport authenticate facebook lt gt Scopes scope pages show list instagram basic instagram content publish passport authenticate creates a middleware for the given strategy It redirects the user to Facebook with URL parameters so that Facebook knows what application is the user authorizing and where the user should be then redirected back The authenticate function accepts a second parameter with additional options where the most important is scopes Authorization scopes permissions passport authenticate facebook lt gt Scopes scope pages show list instagram basic instagram content publish OAuth scopes define what the application is allowed to do on behalf of the user Facebook calls them “permissions The user can then review and approve these permissions In this case we request the following permissions pages show list to list Facebook pages the user manages and allowed for our appinstagram basic to read basic information about an Instagram profileinstagram content publish to allow publishing content this is not needed now but may be useful in the next tutorial You can find additional possible permissions in the Permissions Reference Keep in mind that if you d like your application to be publicly accessible you will have to submit it for an app review and explain how permissions are used Callback handler lt gt Callback handlerapp get auth facebook callback passport authenticate facebook async function req res next This is the final step in the authentication flow After the user authorized your application they are redirected to the auth twitter callback route The passport authenticate middleware is here again but this time it checks the query parameters Facebook provided on redirect and obtains access and refresh tokens If the authentication succeeds the next middleware function is called typically you will display some success message to the user or redirect them back to your application Since the authentication passed you can now find the user data in the req user property Obtaining Instagram profilesasync function req res next try lt gt Obtaining profiles const accessToken req user accessToken const sdkProfile await sdk getProfile social media publishing profiles const result await sdkProfile getUseCase GetProfilesForPublishing perform provider instagram parameters accessToken const profiles result unwrap res send lt h gt Authentication succeeded lt h gt lt h gt User data lt h gt lt pre gt JSON stringify req user undefined lt pre gt lt h gt Instagram profiles lt h gt lt pre gt JSON stringify profiles undefined lt pre gt next catch err next err The route handler uses Superface OneSDK to fetch basic data about Instagram profiles we have access to I use GetProfilesForPublishing for that which also works with Facebook LinkedIn Pinterest and Twitter The logic is the same as in the previous Find the right account ID tutorial except we are passing the access token stored in session from req user accessToken see the code for the Success callback Next stepsOne issue with the example code is that both the user data and the access token are stored in memory The user needs to go through the authentication flow every time the server is restarted For a real world use you will need to persist the data using for example a configuration file or a database In future tutorials I will look at publishing of images and videos searching hashtags and retrieving posts and comments If you don t want to miss them subscribe to our blog via RSS or follow Superface on Twitter Did you run into any problems I will be happy to help you on our Discord 2023-01-03 13:16:21
海外TECH DEV Community 7 Subtle Signs of Developer Burnout — And How to Recover From It https://dev.to/codewithvoid/7-subtle-signs-of-developer-burnout-and-how-to-recover-from-it-3klj Subtle Signs of Developer Burnout ーAnd How to Recover From ItBurnouts are inevitable in a long career in tech These signs will help you in identifying it early and love your work againLet s dive in ↓ TL DRYou feel isolatedYou regularly miss deadlinesYou don t get proper sleepYou are being overworkedYou constantly lack motivationYou don t take breaksYou often feel distracted You feel isolated in people deal with workplace loneliness Feeling disconnected from peers is a terrible feeling Make new connections and find opportunities to collaborate Volunteer and rise by lifting others You regularly miss deadlines We all suffer with optimism bias That makes us underestimate time and roadblocks in completing the tasks Schedule buffer time and cut yourself some slack While planning assume the worst You don t get proper sleep You find yourself in a state of stress ーor have poor sleep habits Lack of sleep costs you more than just drowsiness For better sleep Avoid large mealsGet some exerciseLimit CaffeineMost importantly make time for sleep You are being overworked Ever felt that you lack energy for simplest tasks That s because your mind is overwhelmed Take time to plan and set realistic expectations Value health before sickness You constantly lack motivation So you feel you are NOT making progress Revive your motivation by Learning new thingsSide projectsCollaboratingHave goals not chores You don t take breaks ️By not taking breaks You are starving your body and mind from recharge Add effective breaks to your work routine Standup and stretchBreathing exercisesShort walksLearn to rest your mind You often feel distracted You are constantly bombarded by MessagesNotificationsInterruptionsIdentify and eliminate distractions from your work environment Block time for what needs to be done Focus and win Wrapping up That s it I hope you found these tips helpful If you liked this post follow me for more of these Also share how do you avoid or recover from burnout in comments 2023-01-03 13:12:23
Apple AppleInsider - Frontpage News Future Apple Pencil could detect colors and textures https://appleinsider.com/articles/23/01/03/future-apple-pencil-could-detect-colors-and-textures?utm_medium=rss Future Apple Pencil could detect colors and texturesApple could be planning a real world equivalent of the familiar eye dropper tool in image apps where a color could be set by an Apple Pencil tapping against it in an existing image Back in Apple applied for a patent concerning an Apple Pencil that could include an on board display that showed different colors In that case the idea was that a user would see what color pen or brush stroke was about to be applied Now a new patent application suggests what in hindsight seems like an obvious extension of this According to the proposals in Electronic Device With Optical Sensor For Sampling Surfaces the Pencil tip could sense colors Read more 2023-01-03 13:38:41
Apple AppleInsider - Frontpage News India may spare AirPods, Apple Watch from USB-C charger rules https://appleinsider.com/articles/23/01/03/india-may-spare-airpods-apple-watch-from-usb-c-charger-rules?utm_medium=rss India may spare AirPods Apple Watch from USB C charger rulesIndia will be excluding wearable devices and audio items such as the Apple Watch and AirPods from forthcoming rules requiring the use of USB Type C for charging A USB C cable After the European Union introduced regulations requiring electronics producers to use USB C as part of a common charger directive effectively forcing the iPhone to USB C in India has announced that it is introducing similar rules However lawmakers won t necessarily be going as far as its EU counterparts Read more 2023-01-03 13:16:22
海外TECH CodeProject Latest Articles Dapper The Pocket Rocket Mapper https://www.codeproject.com/Articles/5351042/Dapper-The-Pocket-Rocket-Mapper application 2023-01-03 13:58:00
海外科学 NYT > Science 2023 Space and Astronomy News: What to Expect https://www.nytimes.com/2023/01/03/science/space-and-astronomy-what-to-expect-in-2023.html space 2023-01-03 13:11:46
海外科学 NYT > Science Sync Your Calendar With the Solar System. https://www.nytimes.com/explain/2023/01/01/science/astronomy-space-calendar event 2023-01-03 13:11:49
ニュース @日本経済新聞 電子版 東京都内のアンテナショップが2022年に初めて減少。群馬県は「ぐんまちゃん家」を閉店。ピーク時は年57万人来店していましたが、21年度は13万人に。デジタル化やコロナの影響でブームは曲がり角を迎えています。… https://t.co/1GfS6fvxiE https://twitter.com/nikkei/statuses/1610268504309088257 東京都内のアンテナショップが年に初めて減少。 2023-01-03 13:35:03
ニュース @日本経済新聞 電子版 「スシロー」海外出店50~60店、初の国内超え 23年計画 https://t.co/EhgwK2SZyU https://twitter.com/nikkei/statuses/1610266884674580480 海外 2023-01-03 13:28:37
ニュース BBC News - Home Wearing a mask if ill is sensible advice - minister https://www.bbc.co.uk/news/health-64151557?at_medium=RSS&at_campaign=KARANGA intolerable 2023-01-03 13:22:17
ニュース BBC News - Home First migrants of 2023 cross Channel in small boat https://www.bbc.co.uk/news/uk-64149989?at_medium=RSS&at_campaign=KARANGA border 2023-01-03 13:54:35
ニュース BBC News - Home Damar Hamlin: NFL player in critical condition after cardiac arrest https://www.bbc.co.uk/news/world-us-canada-64149300?at_medium=RSS&at_campaign=KARANGA buffalo 2023-01-03 13:14:07
ニュース BBC News - Home De La Soul: Classic back catalogue finally available for streaming https://www.bbc.co.uk/news/entertainment-arts-64152051?at_medium=RSS&at_campaign=KARANGA march 2023-01-03 13:30:22
ニュース BBC News - Home Enzo Fernandez: Chelsea in talks with Benfica over Argentina midfielder https://www.bbc.co.uk/sport/football/64153624?at_medium=RSS&at_campaign=KARANGA fernandez 2023-01-03 13:21:36
ニュース BBC News - Home Joe Marler: England and Harlequins prop used offensive comment about Jake Heenan's mother https://www.bbc.co.uk/sport/rugby-union/64153235?at_medium=RSS&at_campaign=KARANGA Joe Marler England and Harlequins prop used offensive comment about Jake Heenan x s motherEngland and Harlequins prop Joe Marler made an offensive comment about Bristol flanker Jake Heenan s mother which led to his six week ban 2023-01-03 13:08:09
北海道 北海道新聞 電気柵でクマ追い払い作戦 市街地隣接の札幌・藻岩山など3山 市が23年度検討 https://www.hokkaido-np.co.jp/article/783259/ 電気柵 2023-01-03 22:38:01
北海道 北海道新聞 <GO!GO!ファイターズ>今季の展望 3氏紙上対談 https://www.hokkaido-np.co.jp/article/783282/ 長谷川 2023-01-03 22:31:00
北海道 北海道新聞 スノーモービルの男性死亡 上川 https://www.hokkaido-np.co.jp/article/783281/ 上川町越路 2023-01-03 22:29:00
北海道 北海道新聞 マイナ保険証の対応に遅れ 病院3割弱、4月まで間に合わず https://www.hokkaido-np.co.jp/article/783280/ 健康保険証 2023-01-03 22:24:00
北海道 北海道新聞 故郷の正月、楽しかった 釧根でもUターンラッシュ https://www.hokkaido-np.co.jp/article/783279/ 年末年始 2023-01-03 22:23:00
北海道 北海道新聞 道内Uターンピーク大雪直撃 道央道通行止めで国道渋滞 JR運休 https://www.hokkaido-np.co.jp/article/783277/ 年末年始 2023-01-03 22:22:43
北海道 北海道新聞 クレインズ支援で釧路市に500万円寄付 東京のネット広告企業 https://www.hokkaido-np.co.jp/article/783278/ 釧路市 2023-01-03 22:22:00
北海道 北海道新聞 「自分の人生、一歩ずつ進む」 新得、広尾、陸別で成人式 https://www.hokkaido-np.co.jp/article/783275/ 成人の日 2023-01-03 22:17:00
北海道 北海道新聞 陸別で氷点下30.6度 今季の道内最低を記録 https://www.hokkaido-np.co.jp/article/783274/ 十勝管内 2023-01-03 22:16:00
北海道 北海道新聞 飛躍の卯年、前へ 道東の年男・年女3人に抱負聞く https://www.hokkaido-np.co.jp/article/783272/ 道東 2023-01-03 22:09:00
北海道 北海道新聞 故郷で充電、日常へ オホーツク管内もUターンピーク https://www.hokkaido-np.co.jp/article/783271/ 年末年始 2023-01-03 22:01:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)