投稿時間:2023-08-21 22:22:39 RSSフィード2023-08-21 22:00 分まとめ(20件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… 「iPhone 15 Ultra」の噂が再び https://taisy0.com/2023/08/21/175586.html appleinsi 2023-08-21 12:29:06
ROBOT ロボスタ 建ロボテック 5社の第三者割当増資による総額1.5億円のシリーズBの資金調達を実施 累計調達額は6億円に https://robotstart.info/2023/08/21/kenrobotech-finance-seriesb-round.html 2023-08-21 12:13:25
ROBOT ロボスタ KEENON Roboticsが最新型の配膳・配送・下げ膳ロボット2機種を発表 最大20台まで複数ロボットの共同稼動が可能 https://robotstart.info/2023/08/21/keenonrobotics-2-robots-release.html KEENONRoboticsが最新型の配膳・配送・下げ膳ロボット機種を発表最大台まで複数ロボットの共同稼動が可能シェアツイートはてブKEENONRoboticsは、最新型となる配膳・配送・下げ膳ロボット「DINERBOTTPro」と「DINERBOTT」を発表した。 2023-08-21 12:07:21
海外TECH MakeUseOf Netflix Not Working? 11 Ways to Fix Netflix Issues and Problems https://www.makeuseof.com/tag/fix-netflix-not-working/ netflix 2023-08-21 12:01:26
海外TECH DEV Community Mastering State Management in React eCommerce with Redux Toolkit! https://dev.to/aeeshah/mastering-state-management-in-react-ecommerce-with-redux-toolkit-1dmp Mastering State Management in React eCommerce with Redux Toolkit Introduction In modern web development state management plays a crucial role in creating dynamic and responsive user interfaces In this tutorial we will delve deep into state management by using Redux Toolkit to enhance the functionality of our React based eCommerce website Redux Toolkit simplifies the process of managing state in complex applications and we ll explore its features to build a more organized and maintainable codebase Prerequisites Basic understanding of React and JavaScriptFamiliarity with Redux concepts actions reducers store Table of Contents Setting Up Redux Toolkit in Your React ProjectDefining Slices and ReducersDispatching Actions and Updating StateIntegrating Redux Toolkit with the eCommerce Application Setting Up Redux Toolkit in Your React Project To begin let s install the necessary dependencies and set up Redux Toolkit in our React application Open your terminal and run the following commands npm install reduxjs toolkit react reduxNow create a store js file in your project s source directory and set up the Redux store store jsimport configureStore from reduxjs toolkit import rootReducer from reducers Combine your reducers hereconst store configureStore reducer rootReducer export default store Defining Slices and Reducers In Redux Toolkit state is organized into slices and each slice has its own reducer that handles its state changes Let s create a slice for managing products productSlice jsimport createSlice from reduxjs toolkit const productSlice createSlice name products initialState reducers setProducts state action gt return action payload Add more reducer functions here export const setProducts productSlice actions export default productSlice reducer Dispatching Actions and Updating State To update the state using Redux Toolkit dispatch actions defined in your slices Here s how to dispatch the setProducts action import useDispatch from react redux import setProducts from productSlice function ProductList const dispatch useDispatch useEffect gt Simulate fetching products from an API const fetchedProducts Replace with actual data dispatch setProducts fetchedProducts dispatch return lt div gt lt h gt product name lt h gt lt p gt product description lt p gt lt button onClick handleAddToCart gt Add to Cart lt button gt lt div gt Integrating Redux Toolkit with the eCommerce Application To integrate the Redux store with your app wrap your main component with the Provider component from react redux index jsimport React from react import ReactDOM from react dom import Provider from react redux import store from store import App from App ReactDOM createRoot document getElementById root as HTMLElement render lt Provider store store gt lt App gt lt Provider gt Conclusion In this part of the tutorial we ve laid the foundation for state management using Redux Toolkit in our React eCommerce application We ve learned how to set up the Redux store define slices and reducers and dispatch actions to update the state 2023-08-21 12:55:56
海外TECH DEV Community Cookies vs Local Storage in JavaScript https://dev.to/diwakarkashyap/cookies-vs-local-storage-in-javascript-3m0h Cookies vs Local Storage in JavaScriptBoth cookies and localStorage are ways to store data on the client s side but they have different purposes use cases and characteristics Here s a comparison of the two Lifespan Cookies Can have a set expiration date If not set they will expire at the end of a session i e when the browser closes LocalStorage Does not have an expiration date Data persists until explicitly deleted Capacity Cookies Limited to KB per cookie LocalStorage Typically browsers allocate around MB for localStorage though the exact amount can vary by browser Scope Cookies Scoped to domains and paths Can be sent with every HTTP request to the domain if the cookie s domain and path match the request LocalStorage Only accessible via JavaScript on the same domain Data stored in localStorage is not sent with HTTP requests Performance Cookies Since they are sent with every HTTP request to a domain if they match domain and path they can potentially slow down web traffic slightly LocalStorage Does not impact HTTP traffic as the data is only stored and accessed client side Server Side Cookies Can be read server side which is useful for authentication tokens and other server side tasks LocalStorage Cannot be read server side Data Type Cookies Only stores strings LocalStorage Though it inherently stores everything as a string objects can be stored as well using JSON stringify when saving and JSON parse when retrieving Security Cookies Can be secure if set with the Secure flag and only transmitted over HTTPS Also can be flagged HttpOnly which means they cannot be accessed via JavaScript providing some protection against cross site scripting XSS attacks LocalStorage Vulnerable to cross site scripting XSS attacks If an attacker can run JavaScript on a website they can access and modify localStorage Use Cases Cookies Typically used for sessions user identification and tracking LocalStorage Great for storing larger amounts of non sensitive data on the client side like user settings cached data or offline app data Ease of Use Cookies A bit more cumbersome to work with in JavaScript without libraries LocalStorage Has a very straightforward API e g localStorage setItem key value and localStorage getItem key Other Storage Options Beyond cookies and localStorage modern browsers also offer sessionStorage similar to localStorage but expires with the session and IndexedDB a more complex client side database system In conclusion while both cookies and localStorage offer client side data storage their use cases characteristics and technical details vary greatly The choice between them largely depends on the specific requirements of your web application Thank you for reading I encourage you to follow me on Twitter where I regularly share content about JavaScript and React as well as contribute to open source projects and learning golang I am currently seeking a remote job or internship Twitter GitHub Portfolio 2023-08-21 12:55:53
海外TECH DEV Community Enable CORS in ASP.NET Core in the Easiest Way https://dev.to/bytehide/enable-cors-in-aspnet-core-in-the-easiest-way-3c5i Enable CORS in ASP NET Core in the Easiest WayIn this guide we ll see the core principles of Cross Origin Resource Sharing CORS in ASP NET Core We will cover its role in web applications provide practical examples and highlight some common mistakes to avoid Let s dive in Introduction to CORSEver wondered about the invisible rules that keep your website interactions safe and secure That s where CORS or Cross Origin Resource Sharing comes in This primer will help us understand its importance in our web applications Understanding CORS and Its ImportanceCORS or Cross Origin Resource Sharing allows or restricts external domains to access resources from your domain Imagine you re hosting a party your website and CORS is the bouncer deciding who gets in requests based on the guest list rules you ve set Oh and that party It s one thrilling and secure online experience An example of a CORS rules app UseCors builder gt builder WithOrigins AllowAnyMethod AllowAnyHeader How Does CORS WorkOnce you send a request from a client to a server in the dance of web communication the server responds with access control headers These headers decide who gets to dance along to the beat the resources But hey let s not only talk in riddles let s dive deeper into CORS s working mechanism in ASP NET Core context in the next sections Example of server CORS headersAccess Control Allow Origin http domain comAccess Control Allow Methods POST GET Setting Up the Development Environment for ASP NET CoreSoftware development is a bit like cooking the right ingredients and proper tools can make all the difference In our case those tools are mainly software and your willpower to code Required Tools and SoftwareTo cook up an irresistible ASP NET Core application you ll need NET Core SDK Visual Studio or any other preferred code editor A burning desire to code Installing the NET Core SDK gives you access to the dotnet CLI command With it you can create a new ASP NET Core projectdotnet new webapp o MyWebAppcd MyWebAppdotnet watch run Creating Your First ASP NET Core ApplicationLike a chef preparing a new recipe let s create our first ASP NET Core web application By doing so we ll lay the groundwork necessary to explore CORS in ASP NET Core in the upcoming sections Let s create a new project using CLI dotnet new webapp o MyASPAppVoila You have created your first ASP NET Core application Basic Concepts of CORS in NET CoreLet s refresh our basics every master coder was once a beginner right CORS is central to ASP NET Core especially when developing web applications that interact with resources from different domains Here you re allowing CORS for an array of specific domains app UseCors builder gt builder WithOrigins AllowAnyMethod AllowAnyHeader How to Enable CORS in ASP NET CoreHey friend ready to enable your first CORS in ASP NET Core Well buckle up because you re in for an exhilarating ride Step by step Guide to Enabling CORS in Web API NET CoreFirstly we need to install the Microsoft AspNetCore Cors package Then add the CORS service in ConfigureServices method and apply the policy in the Configure method I know it sounds tricky but let s break it down step by step with code examples Step Install the Microsoft AspNetCore Cors packagedotnet add package Microsoft AspNetCore CorsStep Add CORS services in the ConfigureServices methodpublic void ConfigureServices IServiceCollection services services AddCors options gt options AddPolicy AllowAll builder gt builder AllowAnyOrigin AllowAnyMethod AllowAnyHeader Step Apply the policy in the Configure methodpublic void Configure IApplicationBuilder app app UseCors AllowAll Understanding NET Core Allow CORS MethodsAre you tired of the legends and myths surrounding NET Core Allow CORS methods Time to bust those myths with some concrete knowledge and non negotiable facts And yep you guessed it we ll see how we can apply these CORS methods to our ASP NET Core application NET Core Allow CORS methods at a glance app UseCors builder gt builder AllowAnyOrigin Allow requests from any originapp UseCors builder gt builder WithOrigins Allow requests only from domain comapp UseCors builder gt builder AllowAnyHeader Allow any header in the requestapp UseCors builder gt builder AllowAnyMethod Allow any HTTP method in the requestThat concludes our fascinating tour into the world of CORS in ASP NET Core We ve demystified CORS danced around with its implementation in ASP NET Core and even seen how we can enable it Remember the ASP NET Core world is your oyster and CORS is your pearl of secure web communication Practical Examples of Using CORS in ASP NET CoreOur journey into the realm of CORS and ASP NET Core just got more interesting Ready to roll up your sleeves and dive head first into some real world examples Let s do it A Practical Example of CORS ASP NET CoreCORS and ASP NET Core go together like bread and butter cookies and milk or…well you get the idea To make this partnership crystal clear let s look at a practical example where we configure an ASP NET Core application to allow requests from specific origins In Startup cs configure services method we add a CORS policy public void ConfigureServices IServiceCollection services services AddCors options gt options AddPolicy AllowSpecificOrigin builder gt builder WithOrigins AllowAnyHeader AllowAnyMethod Bazinga We have set a CORS policy “AllowSpecificOrigin that allows requests from the domains and ASP NET Core CORS Allow All What Does It Mean and When to Use ItSometimes you simply want to open all the doors and have a grand open house Or in tech terms you want to accept requests from all origins Let s see how we can “allow all using ASP NET Core CORS We add a policy in Startup cs that allows allpublic void ConfigureServices IServiceCollection services services AddCors options gt options AddPolicy AllowEverything This is the open house we talked about builder gt builder AllowAnyOrigin Any origin is welcome AllowAnyHeader With any type of headers AllowAnyMethod And any HTTP methods Such a jolly party indeed And there you have it friend The ASP NET Core CORS Allow All policy in its full glory Applying CORS policies on a granular level e g to individual controllers or actions can give you more control over your application But remember with great power comes great responsibility so make sure you handle your CORS powers wisely Deep Dive into CORS Policies in ASP NET CoreAs we continue our journey through the core of CORS policies within ASP NET Core we re about to dive even deeper Brace yourself as we go under the hood and explore how to tailor CORS policies to suit specific use cases Notice what I did there Brace Dive Alright let s move on… Adding CORS Policies in ASP NET Core An In Depth GuideCrafting CORS policies is like sculpting a piece of art it gives you control over who can admire access your masterpiece web application and how they can interact with it With that spirited analogy let s go on a crafty expedition to add and configure CORS policies in ASP NET Core In Startup cs let s add a CORS policy public void ConfigureServices IServiceCollection services services AddCors options gt options AddPolicy OnlyGetAndPostPolicy A catchy policy name builder gt Only requests from and that use GET or POST methods and with any headers are allowed builder WithOrigins WithMethods GET POST AllowAnyHeader And just like that we have a fine tuned CORS policy named OnlyGetAndPostPolicy That was exhilarating right But wait there s more Enable CORS NET Core Understanding CORS Policy OptionsBattles are won by understanding your weapons Knowing CORS policy options comes handy when tailor making your own policies Let s dive into the ocean of policy options so we can emerge as triumphant warriors safeguarding our apps from unnecessary cross origin requests Here is a snapshot of CORS policy options WithOrigins To allow requests only from specific domains AllowAnyOrigin To accept requests from any domain use with caution AllowAnyMethod To allow any HTTP method GET POST PUT etc in the request WithMethods To specify which HTTP methods are allowed in the request AllowAnyHeader To accept any HTTP request header WithHeaders To specify which HTTP headers are allowed in the request WithExposedHeaders To specify which headers are safe to expose to the API of a CORS API specification AllowCredentials To allow requests with credentials Clearly these options are your sword and shield while configuring CORS policies in ASP NET Core Now let s apply this freshly acquired knowledge to use the AllowSpecificOrigins policy ASP NET Core Allow CORS Utilizing the AllowSpecificOrigins PolicyThe AllowSpecificOrigins policy is like the gatekeeper of your ASP NET Core application It allows entry only to the domains on your guest list Let s see how this policy can be used to manage cross origin requests Remember our lovely analogy about a party Yeah we re hanging on to it public void ConfigureServices IServiceCollection services services AddCors options gt options AddPolicy AllowSpecificOrigins The policy name builder gt Welcome Requests from these domains can access my party web application builder WithOrigins AllowAnyHeader You can wear anything to my party any headers are allowed AllowAnyMethod And bring any dish any HTTP methods are allowed Everyone s welcome Remember how we learned to ride a bike Start slow understand how it works fall maybe a little get up and then ride like a champ Well that s pretty much how you master CORS policies in ASP NET Core You start by understanding what CORS is dive into how CORS works in ASP NET Core understand how to enable it and finally nail it by adding intricately designed policies CORS Middleware in NET Up next we ll unfold the mystery surrounding the pivotal role of middleware in NET while managing CORS It s about to get even more technical and exciting so hold on to your hats Understanding the Role of Middleware in Net Core CORS HandlingIn the grand orchestra of NET middleware is like a conductor managing how different components interact with each other It s a pivotal cog in the machine especially when handling CORS Let s examine this conductor s role and see how well it plays the symphony of the cross origin resource sharing An example of CORS Middleware in NET var builder WebApplication CreateBuilder args builder Services AddCors options gt options AddDefaultPolicy builder gt builder WithOrigins AllowAnyHeader AllowAnyMethod var app builder Build app UseCors rest of your code How to AddCORS Middleware in NET Core Alrighty ready to play the role of conductor and add CORS middleware to your NET application Let s create a harmonious symphony that revolves around allowing cross origin requests from specific domains In the process you ll understand how middleware can make your life easier Let s go ahead and add CORS middleware in our NET application var builder WebApplication CreateBuilder args builder Services AddCors options gt options AddDefaultPolicy builder gt builder WithOrigins AllowAnyHeader AllowAnyMethod var app builder Build app UseCors Now your application will accept cross origin requests from That s pretty much everything you need to get started with CORS in ASP NET Core and NET At this point you should be familiar with how CORS works why it s crucial for your applications and how to implement it using middleware in NET Congratulations you re now a CORS ninja But wait that s not it All ninjas should be ready to avoid traps during their mission So let s discuss some common pitfalls and best practices when implementing CORS in ASP NET Core Avoid Common Mistakes with CORS in ASP NET CoreCORS in NET Core opens up a world of connectivity but the road to success is riddled with pitfalls Let s be prepare ourselves to step wisely on this path Pitfalls in CORS NET Core What to Watch Out ForIn this enlightening quest of CORS in NET Core one cannot ignore the potential pitfalls threatening to throw us off track However with our guide to common mistakes and solutions these won t seem menacing anymore Firstly always be vigilant about the middleware order The positioning of app UseCors is paramount in your configuration public void Configure IApplicationBuilder app app UseRouting app UseAuthorization Order is wrong app UseCors Place UseCors before UseAuthorization public void Configure IApplicationBuilder app app UseRouting app UseCors This is correct app UseAuthorization Secondly never pair AllowAnyOrigin and AllowCredentials due to potential security risks It s akin to leaving your front door open public void ConfigureServices IServiceCollection services services AddCors options gt options AddDefaultPolicy builder gt builder AllowAnyOrigin AllowCredentials Not advisable Let s not forget CORS is not a substitute for user authorizations and permissions CORS merely adds an additional layer of security public void ConfigureServices IServiceCollection services services AddCors options gt options AddDefaultPolicy builder gt builder WithOrigins AllowAnyMethod AllowAnyHeader services AddAuthorization Remember the need for authorization Remember a keen eye cautious mind and double checking your code can save you from these pitfalls in the journey of CORS in NET Core Best Practices for Implementing CORS CThe path to becoming an exemplary C developer is not just steering clear of blunders but embracing best practices So let s stroll through essential practices in the realm of CORS C Firstly do not use AllowAnyOrigin and AllowAnyMethod in production an open door is an invitation to trouble services AddCors options gt options AddPolicy Open policy gt policy AllowAnyOrigin Not recommended for production AllowAnyMethod Also not recommended for production Implement vigorous CORS policies by regulating the origins headers and methods services AddCors options gt options AddPolicy Specific policy gt policy WithOrigins Only requests from specificdomain com WithMethods GET POST Only allowing GET and POST methods WithHeaders header header Only allowing specific headers Lastly never underestimate the vitality of updates Imagine always carrying the latest toolkit it s a lifesaver Keep an eye on the official ASP NET Core documentation for updates Stay proactive in updating your CORS middleware to the latest versionFollowing these practices could be your first steps towards becoming a trusted and respected C developer Aim high friend Recap of Enabling CORS in Net CoreWe broke down the fundamentals of CORS explored how to set up the development environment for ASP NET Core examined the roles and methods of enabling CORS and gave you the practical examples you needed We then took a thrilling plunge into CORS policies saw how middleware fits into the picture and even debunked some CORS related myths 2023-08-21 12:48:19
海外TECH DEV Community 🦄 How ToolJet Gained 20,000 GitHub Stars and 400 Contributors https://dev.to/tooljet/how-tooljet-gained-20000-github-stars-and-400-contributors-4ee0 How ToolJet Gained GitHub Stars and Contributors OverviewOpen source projects aim to gain momentum by attracting an ample user base and contributors establishing a thriving and self sustaining venture that resonates with the intended audience However the crux of the matter is discovering effective strategies to captivate users and developers for project reach and engagement ToolJet stands as an exemplary open source low code platform that empowers both developers and business users to swiftly craft applications by establishing direct connections with diverse databases and services Our journey has led us to a significant milestone of GitHub stars accompanied by a vibrant community of contributors This achievement not only reflects numerical growth but also underscores our evolution into a thriving ecosystem of engaged users and contributors In the spirit of fostering collaboration and learning we re eager to share some of the strategic initiatives that have propelled our progress It is our hope that these insights may provide valuable guidance to fellow open source projects seeking to flourish in a similar manner Awareness BuildingCultivating awareness and garnering a dedicated user base is essential for sustained growth and development A powerful strategy to achieve this is by actively engaging with platforms that cater to tech savvy enthusiasts such as Reddit s r selfhosted This subreddit serves as a vibrant hub for discussions and recommendations surrounding self hosted software and projects By participating in relevant discussions sharing valuable insights and showcasing the unique features and benefits of your open source project you can tap into a community of individuals who are already enthusiastic about self hosting solutions This interaction not only brings your project to their attention but also establishes a direct line of communication allowing you to receive feedback address concerns and foster genuine connections with potential users and contributors In doing so you not only increase the visibility of your open source project but also lay the foundation for a loyal and engaged user base that can greatly contribute to the project s success over time Here s how the subreddit selfhosted helped us to boost the ToolJet launch that brought awareness about the prominent features Strategic LaunchesBy strategically timing and presenting significant updates on platforms like Product Hunt open source projects can tap into a community of tech enthusiasts innovators and potential collaborators In this case Product Hunt s engaged audience always on the lookout for novel solutions offers a unique opportunity to showcase new features and improvements This exposure not only generates interest and feedback but also creates a sense of excitement around the project s progress Our debut on Product Hunt propelled ToolJet to the top spot as the Product of the Dayand an impressive rd position in the coveted Product of the Week rankings Content EnablementLeveraging current trends on platforms like DEV can maximise product visibility By constant content production and aligning them with trending topics you can effectively capture the attention of a wide audience This strategy was supportive for us in the past with our previous DEV blogs reaching thousands of viewers For instance our articles on building internal tools with ChatGPT s integration garnered substantial engagement demonstrating the power of leveraging trending discussions to enhance content visibility and engagement Building an intelligent CRM using ChatGPT PostgreSQL and ToolJet Shubhendra Singh Chauhan for ToolJet・May webdev javascript chatgpt lowcode Creating a SQL generator app with ChatGPT PostgreSQL and ToolJet Teja Kummarikuntla for ToolJet・Mar sql tooljet javascript chatgpt Collaborative OutreachEngaging in collaborative outreach allows open source projects to establish symbiotic partnerships with like minded companies nurturing mutual growth and innovation Identifying win win opportunities becomes pivotal in this endeavor ensuring that both parties gain value from the collaboration Equally crucial is setting clear prioritized outcomes to steer efforts effectively Measuring results and gleaning insights from these collaborations then forms the foundation for future engagements Notable instances of such collaborations for ToolJet include with industry leaders like MongoDB Stripe GitHub MariaDB and more where joint efforts have led to address the relevant audience effectively Nurturing Contributor CommunityCultivating an engaged project repository is crucial for nurturing community growth and maintaining a responsive development environment Simultaneously our active approach to encouraging contributor engagement is highlighted by our strategic emphasis on showcasing ToolJet s expanding contributor base This is achieved by creating and managing accessible good first issues which offer contributors opportunities to address specific product concerns Through this approach we not only strengthen our community but also enhance the project s overall quality by collaboratively addressing pertinent issues Community EngagementActive engagement with users plays a pivotal role in nurturing meaningful interactions within a project s user base Recognizing the significance of direct communication ToolJet regularly hosts community calls in the last week of every month These sessions provide an opportunity not only to share updates on releases and demonstrate features but also to educate users about specific usage aspects and best practices These collaborative interactions encourage open discussions and valuable feedback from the community The insights garnered from these conversations serve as a valuable resource for internal decisions enabling them to refine and enhance their products based on community expectations and requirements Evangelizing on the groundElevating awareness of the open source product through active engagement in relevant conferences and meet ups stands as a potent strategy These gatherings offer an optimal platform to spotlight the product s value advantages and distinctive attributes directly to a receptive audience Notably ToolJet has consistently participated in open source conferences like IndiaFOSS and FOSS Hack hackathons leveraging the conversations informative exchanges and the cultivation of connections These events effectively disseminate product information within a community that shares common interests and requirements This proactive approach not only builds brand recognition but also positions the open source product as a pertinent and influential solution within its niche ConclusionAs we reflect on this milestone it s essential to recognize that each platform offers a unique landscape and experimentation is key What worked for us might require adaptation for others The journey is one of perpetual learning where embracing new approaches seeking valuable feedback and nurturing authentic connections contribute to a thriving open source ecosystem So while our story may inspire it s your experimentation and commitment that will shape your own success story leading to impactful stars contributors and accomplishments We sincerely hope that these insights find their way into your project s growth journey Thank you for taking the time to read through and explore our journey Feeling intrigued by our journey Take a closer look at ToolJet on GitHub and consider giving it a star️if it captures your interest Dive into the project s potential by exploring the good first issues and up for grabs your contribution could be the next step towards shaping our collective endeavor 2023-08-21 12:48:16
海外TECH DEV Community 🔥🤖 Automate MEMEs posting to your Discord with NodeJS and Novu 🚀🚀 https://dev.to/novu/automate-memes-posting-to-your-discord-with-nodejs-and-novu-28hi Automate MEMEs posting to your Discord with NodeJS and Novu TL DRIn this tutorial you ll learn how to build an automated Discord bot with Novu The bot will send memes from a subreddit to your Discord channel every hour Novu Open source notification infrastructure Just a quick background about us Novu is an open source notification infrastructure We basically help to manage all the product notifications It can be In App the bell icon like you have in the Dev Community Emails SMSs and so on Let s set it up Create your project folder and run npm init y to add a package json file mkdir discord botcd discord botnpm init yInstall Novu SDK  Nodemon  Node Cron and Fast XML Parser npm install novu node fast xml parser node cron nodemonNovu enables us to send Discord messages in Node js Node Cron helps with scheduling tasks Fast XML Parser for converting XML files to JSON and Nodemon is a Node js tool that automatically restarts the server after detecting file changes Create an index js file the entry point to the web server touch index jsConfigure Nodemon by adding the start command to the list of scripts in the package json file The code snippet below starts the server using Nodemon In server package json scripts test echo Error no test specified amp amp exit start nodemon index js Congratulations You can now start the server by using the command below npm start Getting memes from Reddit Copy the code below into the index js file const XMLParser require fast xml parser const parser new XMLParser Regex for retrieving memes image URLconst urlPattern https i redd it g const getMemes async gt const matchedUrls try fetch XML data const fetchMeme await fetch const XMLdata await fetchMeme text convert XML data to JSON format const jsonObj parser parse XMLdata const content jsonObj feed entry map through the memes data const contentArray content map obj gt obj content contentArray forEach htmlString gt const matches htmlString match urlPattern if matches Add memes into an array matchedUrls push matches return matchedUrls catch err console error err log memes array to the console for testing purposes const logMemes async gt const memes await getMemes console log memes logMemes The code snippet above fetches the XML data RSS feed from the ProgrammerHumor subreddit converts it to JSON format using the XMLParser and retrieves only the memes from the large amount of data returned Reddit to Discord using Novu 🪄Here you ll learn how to send messages to your Discord channels with Novu  an open source notification infrastructure that enables you to send in app SMS chat push and e mail notifications from a single dashboard Before we proceed create your Discord server and right click on the channel where you need to add the bot Select Edit Channel gt Integrations and Webhooks to create a new webhook URL Copy the Copy Webhook URL and paste somewhere on your computer we ll use it shortly Creating a Novu projectRun the code snippet below to create your Novu account npx novu initEnter your application name and sign in to your Novu dashboard The code snippet below contains the steps you need to follow after running npx novu init Now let s setup your account and send your first notification What is your application name Discord Bot Now lets setup your environment How would you like to proceed Create a free cloud account Recommended Create your account with Sign in with GitHub I accept the Terms and Conditions and have read the Privacy Policy YesCreated your account successfully Visit the demo page copy your subscriber ID from the page and click the Skip Tutorial button Next activate the Discord chat channel on your Novu integrations store Finally create a workflow that triggers the Chat notification From the code snippet above I added a variable content as the Chat message content to enable us to send dynamic messages Remember to copy your API key from your dashboard we ll use in the upcoming section Sending messages to the Discord channelAdd the following imports to the top of your index js file const Novu ChatProviderIdEnum require novu node const novu new Novu lt YOUR API KEY gt const subscriberId lt YOUR SUBSCRIBER ID gt Create a function that attach the webhook URL to your subscriber details const sendChatMessage async gt await novu subscribers setCredentials subscriberId ChatProviderIdEnum Discord webhookUrl lt DISCORD WEBHOOK URL gt Finally update the function to loop through the memes retrieved from the subreddit and send them to the Discord channel const sendChatMessage async gt await novu subscribers setCredentials subscriberId ChatProviderIdEnum Discord webhookUrl lt DISCORD WEBHOOK URL gt gets the memes const memes await getMemes loops through the memes memes forEach async meme gt sends the meme via Novu await novu trigger discord to subscriberId payload content meme then res gt console log res data data execute the functionsendChatMessage The code snippet above gets the memes from the previous function getMemes loops through the array and sends them via Novu Congratulations the memes should be displayed with your Discord channel as shown below Check MEMEs every hour with Node Cron Here you ll learn how to schedule tasks with Node Cron tiny task scheduler in pure JavaScript for Node js based on GNU crontab Import the package into the index js file const cron require node cron Then call the sendChatMessage function using Node Cron schedules the task hourlyconst hourlyTask cron schedule sendChatMessage console log Scheduled task to run every hour The code snippet above executes the sendChatMessage function every hour enabling it to fetch the latest and random memes from the subreddit Congratulations on making it thus far  You can learn more about scheduling and automation with Node Cron here Final notes So far you ve learnt how to convert XML data to JSON type send chat messages with Novu automate tasks with Node Cron and build an automated Discord bot with Node js Bots are computer programs designed to perform automated tasks or engage in conversations with people and Discord bots are extremely helpful in tasks like moderation custom commands managing members requests and many more Today if you have a Discord channel you need a bot to help automate most of your moderation tasks The source code for this tutorial is available here   Thank you for reading 2023-08-21 12:12:54
Apple AppleInsider - Frontpage News Are you the world's biggest Apple fan? Here's how to find out https://appleinsider.com/articles/23/08/21/are-you-the-worlds-biggest-apple-fan-heres-how-to-find-out?utm_medium=rss Are you the world x s biggest Apple fan Here x s how to find outA competition is trying to find the biggest Apple fan in the world with the winner crowned the ultimate Apple superfan and winning an Apple Watch Apple Watch Series the prize in the competitionLaunched by price comparison site SellCell com the Battle of the Apple Fans is seeking out diehard Apple followers who Wake up in the middle of the night panicking in a hot sweat because your beloved iPhone isn t on your bedside table Read more 2023-08-21 12:59:18
海外TECH Engadget Tesla says data breach that affected over 75,000 people was caused by 'insider wrongdoing' https://www.engadget.com/tesla-says-data-breach-that-affected-over-75000-people-was-caused-by-insider-wrongdoing-121756644.html?src=rss Tesla says data breach that affected over people was caused by x insider wrongdoing x A Tesla data breach earlier this year affecting more than people was caused by quot insider wrongdoing quot according to a notification on Maine s Attorney General website The people impacted were likely current or former Tesla employees quot While we have not identified evidence of misuse of the data in a manner that may cause harm to you we are nonetheless providing you with this notice to ensure that you are aware of what happened and the measures we have taken quot the company wrote in a letter to employees The breach occurred on May th when the German language newspaper Handelsblatt said it received GB of data from quot several informants quot within Tesla The quot Tesla files quot reportedly contained internal files containing reports of self acceleration issue and cases of braking function problems The latter included complaints about unintentional emergency braking and incidences of phantom stops from false collision warnings nbsp In the employee letter Tesla provided more information about the incident confirming the May breach date and that Handelsblatt had obtained Tesla confidential information quot The investigation revealed that two former Tesla employees misappropriated the information in violation of Tesla s IT security and data protection policies and shared it with the media outlet quot nbsp The data also included employee names and contact information including physical addresses email addresses and mobile phone numbers quot The outlet has stated that it does not intend to publish the personal information and in any event is legally prohibited from using it inappropriately quot Tesla stated It added that several lawsuits resulted in the seizure of devices thought to carry the data and that it had quot obtained court orders that prohibit the former employees from further use access or dissemination of the data quot Last year the National Highway Traffic Safety Administration opened a probe into Tesla s phantom braking issue following owner complaints And in August it was reported that Tesla is facing a class action lawsuit over the same problem nbsp This article originally appeared on Engadget at 2023-08-21 12:17:56
医療系 医療介護 CBnews アルツハイマー新薬「レカネマブ」国内承認へ-薬食審・部会が了承 https://www.cbnews.jp/news/entry/20230821155953 厚生労働相 2023-08-21 21:54:00
ニュース BBC News - Home Families to Letby: 'You played God with our children's lives' https://www.bbc.co.uk/news/uk-66570308?at_medium=RSS&at_campaign=KARANGA letby 2023-08-21 12:48:28
ニュース BBC News - Home No police action over King Charles charity probe https://www.bbc.co.uk/news/uk-66569843?at_medium=RSS&at_campaign=KARANGA foundation 2023-08-21 12:36:36
ニュース BBC News - Home Renting now cheaper than first-time mortgages, says Zoopla https://www.bbc.co.uk/news/business-66568528?at_medium=RSS&at_campaign=KARANGA regional 2023-08-21 12:38:46
ニュース BBC News - Home Black hole in town hall budgets rises to £5bn https://www.bbc.co.uk/news/uk-66428191?at_medium=RSS&at_campaign=KARANGA basic 2023-08-21 12:08:34
ニュース BBC News - Home Rugby World Cup: Wales name Jac Morgan and Dewi Lake as co-captains for tournament https://www.bbc.co.uk/sport/rugby-union/66566287?at_medium=RSS&at_campaign=KARANGA Rugby World Cup Wales name Jac Morgan and Dewi Lake as co captains for tournamentWales boss Warren Gatland chooses flanker Jac Morgan and hooker Dewi Lake as co captains for the World Cup in France as he selects his final man squad 2023-08-21 12:51:57
ニュース BBC News - Home Lucy Letby absence from sentencing 'one final act of wickedness from a coward' https://www.bbc.co.uk/news/uk-66568477?at_medium=RSS&at_campaign=KARANGA Lucy Letby absence from sentencing x one final act of wickedness from a coward x Letby s court absence for her sentencing has renewed calls for the law to be changed to compel convicts to attend 2023-08-21 12:22:32
仮想通貨 BITPRESS(ビットプレス) 楽天ウォレット、8/31に「バイデン政権VSビットコイン~SECの提訴・リップル裁判・ブラックロックのETF」開催 https://bitpress.jp/count2/3_15_13684 裁判 2023-08-21 21:45:39
仮想通貨 BITPRESS(ビットプレス) オーケーコイン・ジャパン、8/28より「アービトラム(ARB)」の取扱開始 https://bitpress.jp/count2/3_10_13683 取扱 2023-08-21 21:42:37

コメント

このブログの人気の投稿

投稿時間: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件)